fix: jpeg options in save screenshot

This commit is contained in:
huangbin.beal@163.com
2024-04-01 16:49:16 +08:00
parent ecdb2cb9e0
commit f6bd3419c0

View File

@@ -276,7 +276,7 @@ func (dExt *DriverExt) saveScreenShot(raw *bytes.Buffer, fileName string) (strin
switch format {
// Convert to jpeg uniformly and compress with a compression rate of 95
case "jpeg", "png":
jpegOptions := &jpeg.Options{Quality: 95}
jpegOptions := &jpeg.Options{}
err = jpeg.Encode(file, img, jpegOptions)
default:
return "", fmt.Errorf("unsupported image format: %s", format)