From 30aaea4584a57b827c71b222dbd1828d13d10b05 Mon Sep 17 00:00:00 2001 From: Darren Yu Date: Sat, 17 Jan 2026 03:24:13 +0800 Subject: [PATCH] feat(thumb): change image type to NRGBA when do resize to keep transparency --- pkg/thumb/builtin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/thumb/builtin.go b/pkg/thumb/builtin.go index 2081a9c2..10174099 100644 --- a/pkg/thumb/builtin.go +++ b/pkg/thumb/builtin.go @@ -120,7 +120,7 @@ func Thumbnail(maxWidth, maxHeight uint, img image.Image) image.Image { func Resize(newWidth, newHeight uint, img image.Image) image.Image { // Set the expected size that you want: - dst := image.NewRGBA(image.Rect(0, 0, int(newWidth), int(newHeight))) + dst := image.NewNRGBA(image.Rect(0, 0, int(newWidth), int(newHeight))) // Resize: draw.BiLinear.Scale(dst, dst.Rect, img, img.Bounds(), draw.Src, nil) return dst