From 8b1aa36a8a9cb45369ad9d7447b84759277df4a4 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Fri, 14 Apr 2023 21:37:35 +0800 Subject: [PATCH] fix: support gif image --- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/ext.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 193b8191..45631758 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.3.2023041421 \ No newline at end of file +v4.3.3.2304142136 \ No newline at end of file diff --git a/hrp/pkg/uixt/ext.go b/hrp/pkg/uixt/ext.go index 5bfe9e09..f110e107 100644 --- a/hrp/pkg/uixt/ext.go +++ b/hrp/pkg/uixt/ext.go @@ -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) }