From 0e5185b92511915b153a0b90d5547b5ef1c593b7 Mon Sep 17 00:00:00 2001 From: David Cuadrado Date: Fri, 20 Nov 2020 15:04:44 -0500 Subject: [PATCH] Fix issue when checking the image size The proper way to get the width and height of the image is using Bounds().Max --- resize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resize.go b/resize.go index 0d7fbf6..549d425 100644 --- a/resize.go +++ b/resize.go @@ -89,7 +89,7 @@ func Resize(width, height uint, img image.Image, interp InterpolationFunction) i } // Trivial case: return input image - if int(width) == img.Bounds().Dx() && int(height) == img.Bounds().Dy() { + if int(width) == img.Bounds().Max.X && int(height) == img.Bounds().Max.Y { return img }