mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: support gif image
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v4.3.3.2023041421
|
v4.3.3.2304142136
|
||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
|
"image/gif"
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
"image/png"
|
"image/png"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@@ -284,6 +285,8 @@ func saveScreenShot(raw *bytes.Buffer, fileName string) (string, error) {
|
|||||||
err = png.Encode(file, img)
|
err = png.Encode(file, img)
|
||||||
case "jpeg":
|
case "jpeg":
|
||||||
err = jpeg.Encode(file, img, nil)
|
err = jpeg.Encode(file, img, nil)
|
||||||
|
case "gif":
|
||||||
|
err = gif.Encode(file, img, nil)
|
||||||
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