fix: error deal

This commit is contained in:
huangbin.beal@163.com
2024-03-29 11:51:30 +08:00
parent 41b32a76a2
commit ecdb2cb9e0

View File

@@ -238,6 +238,9 @@ func compressImageBuffer(raw *bytes.Buffer) (compressed *bytes.Buffer, err error
case "jpeg", "png":
jpegOptions := &jpeg.Options{Quality: 95}
err = jpeg.Encode(&buf, img, jpegOptions)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("unsupported image format: %s", format)
}