Skip to content

Commit

Permalink
round coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 10, 2023
1 parent 250cf6e commit 0daa012
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions service/imaging/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0daa012

Please sign in to comment.