Preserve opacity when resizing on image load

This commit is contained in:
Kovid Goyal
2025-11-15 14:56:21 +05:30
parent 25cf8622bc
commit 68805850a5
3 changed files with 4 additions and 4 deletions

View File

@@ -179,7 +179,7 @@ func (self *ImageFrame) Resize(x_frac, y_frac float64) *ImageFrame {
ans := *self
ans.Width = int(x_frac * float64(width))
ans.Height = int(y_frac * float64(height))
ans.Img = imaging.Resize(self.Img, ans.Width, ans.Height, imaging.Lanczos)
ans.Img = imaging.ResizeWithOpacity(self.Img, ans.Width, ans.Height, imaging.Lanczos, self.Is_opaque)
ans.Left = int(x_frac * float64(left))
ans.Top = int(y_frac * float64(top))
return &ans