fix: support gif image

This commit is contained in:
lilong.129
2023-04-14 21:37:35 +08:00
parent bae5380f80
commit f5935f0ffd
2 changed files with 4 additions and 1 deletions

View File

@@ -1 +1 @@
v4.3.3.2023041421
v4.3.3.2304142136

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"image"
"image/gif"
"image/jpeg"
"image/png"
"math/rand"
@@ -284,6 +285,8 @@ func saveScreenShot(raw *bytes.Buffer, fileName string) (string, error) {
err = png.Encode(file, img)
case "jpeg":
err = jpeg.Encode(file, img, nil)
case "gif":
err = gif.Encode(file, img, nil)
default:
return "", fmt.Errorf("unsupported image format: %s", format)
}