From 0daa012389eddb5565526a45ac3c6dd2247a6b60 Mon Sep 17 00:00:00 2001 From: logica0419 <84759675+logica0419@users.noreply.github.com> Date: Sun, 10 Dec 2023 22:23:32 +0900 Subject: [PATCH] round coordinates --- service/imaging/processor_default.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/imaging/processor_default.go b/service/imaging/processor_default.go index bf49c0ced..fbd172c91 100644 --- a/service/imaging/processor_default.go +++ b/service/imaging/processor_default.go @@ -116,10 +116,10 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b for _, srcFrame := range srcImage.Image { srcBounds := srcFrame.Bounds() destBounds := image.Rect( - int(float64(srcBounds.Min.X)*ratio), - int(float64(srcBounds.Min.Y)*ratio), - int(float64(srcBounds.Max.X)*ratio), - int(float64(srcBounds.Max.Y)*ratio), + int(math.Round(float64(srcBounds.Min.X)*ratio)), + int(math.Round(float64(srcBounds.Min.Y)*ratio)), + int(math.Round(float64(srcBounds.Max.X)*ratio)), + int(math.Round(float64(srcBounds.Max.Y)*ratio)), ) fittedImage := imaging.Resize(srcFrame.SubImage(srcBounds), destBounds.Dx(), destBounds.Dy(), mks2013Filter) destFrame := image.NewPaletted(destBounds, srcFrame.Palette)