From b54395663891b8f801067d8e1c1d5d199cf572f9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Oct 2025 20:29:15 +0530 Subject: [PATCH] ... --- tools/utils/images/convert.go | 3 +++ tools/utils/images/to_rgba.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/utils/images/convert.go b/tools/utils/images/convert.go index ee15d11b1..7ac8f1a83 100644 --- a/tools/utils/images/convert.go +++ b/tools/utils/images/convert.go @@ -136,6 +136,9 @@ func develop_resize(spec string, input_data io.ReadSeeker) (err error) { if err != nil { return err } + if err = images_equal(img, rimg); err != nil { + return fmt.Errorf("roundtripped images not equal: %w", err) + } bimg := rimg.Resize(float64(w)/float64(rimg.Width), float64(h)/float64(rimg.Height)) return images_equal(aimg, bimg) } diff --git a/tools/utils/images/to_rgba.go b/tools/utils/images/to_rgba.go index ae7211bc6..eb4a635b9 100644 --- a/tools/utils/images/to_rgba.go +++ b/tools/utils/images/to_rgba.go @@ -414,6 +414,6 @@ func NewNRGBAWithContiguousRGBAPixels(p []byte, left, top, width, height int) (* return &image.NRGBA{ Pix: p, Stride: bpp * width, - Rect: image.Rectangle{image.Point{left, top}, image.Point{left + width, left + height}}, + Rect: image.Rectangle{image.Point{left, top}, image.Point{left + width, top + height}}, }, nil }