mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
Use CatmullRom instead of ApproxBiLinear for thumbnail generation (#964)
This commit is contained in:
@@ -851,7 +851,7 @@ func (r *AttachmentRepo) processThumbnailFromImage(ctx context.Context, groupId
|
|||||||
}
|
}
|
||||||
newWidth, newHeight := calculateThumbnailDimensions(bounds.Dx(), bounds.Dy(), r.thumbnail.Width, r.thumbnail.Height)
|
newWidth, newHeight := calculateThumbnailDimensions(bounds.Dx(), bounds.Dy(), r.thumbnail.Width, r.thumbnail.Height)
|
||||||
dst := image.NewRGBA(image.Rect(0, 0, newWidth, newHeight))
|
dst := image.NewRGBA(image.Rect(0, 0, newWidth, newHeight))
|
||||||
draw.ApproxBiLinear.Scale(dst, dst.Rect, img, img.Bounds(), draw.Over, nil)
|
draw.CatmullRom.Scale(dst, dst.Rect, img, img.Bounds(), draw.Over, nil)
|
||||||
|
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
err := webp.Encode(buf, dst, webp.Options{Quality: 80, Lossless: false})
|
err := webp.Encode(buf, dst, webp.Options{Quality: 80, Lossless: false})
|
||||||
|
|||||||
Reference in New Issue
Block a user