mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
fix: jpeg options in save screenshot
This commit is contained in:
+1
-1
@@ -276,7 +276,7 @@ func (dExt *DriverExt) saveScreenShot(raw *bytes.Buffer, fileName string) (strin
|
|||||||
switch format {
|
switch format {
|
||||||
// Convert to jpeg uniformly and compress with a compression rate of 95
|
// Convert to jpeg uniformly and compress with a compression rate of 95
|
||||||
case "jpeg", "png":
|
case "jpeg", "png":
|
||||||
jpegOptions := &jpeg.Options{Quality: 95}
|
jpegOptions := &jpeg.Options{}
|
||||||
err = jpeg.Encode(file, img, jpegOptions)
|
err = jpeg.Encode(file, img, jpegOptions)
|
||||||
default:
|
default:
|
||||||
return "", fmt.Errorf("unsupported image format: %s", format)
|
return "", fmt.Errorf("unsupported image format: %s", format)
|
||||||
|
|||||||
Reference in New Issue
Block a user