Commit dfa18fc36 for imagemagick.org

commit dfa18fc36e1705117ac1b0db16006ff340468437
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Fri Dec 4 11:07:45 2026 -0500

    virtual pixels off iterate over only the overlapping region

diff --git a/MagickCore/compare-private.h b/MagickCore/compare-private.h
index b4f9e346f..c7312f595 100644
--- a/MagickCore/compare-private.h
+++ b/MagickCore/compare-private.h
@@ -27,20 +27,20 @@ extern "C" {
 #define DefaultSimilarityThreshold  (-1.0)
 #define MagickSafePSNRRecipicol(x)  ((x)*log10(1.0/MagickEpsilon))

-static inline void SetImageCompareBounds(const Image *image,
-  const Image *reconstruct_image,size_t *columns,size_t *rows)
+static inline void SetImageCompareBounds(const Image *image,const Image *reconstruct_image,
+  size_t *columns,size_t *rows)
 {
   const char *artifact = GetImageArtifact(image,"compare:virtual-pixels");
-  MagickBooleanType vp = (artifact != (const char *) NULL) ?
-    IsStringTrue(artifact) : MagickFalse;
+  MagickBooleanType vp = IsStringTrue(artifact);
+
   if (vp == MagickFalse)
     {
-      *columns=MagickMax(image->columns,reconstruct_image->columns);
-      *rows=MagickMax(image->rows,reconstruct_image->rows);
+      *columns=MagickMin(image->columns,reconstruct_image->columns);
+      *rows=MagickMin(image->rows,reconstruct_image->rows);
       return;
     }
-  *columns=MagickMin(image->columns,reconstruct_image->columns);
-  *rows=MagickMin(image->rows,reconstruct_image->rows);
+  *columns=MagickMax(image->columns,reconstruct_image->columns);
+  *rows=MagickMax(image->rows,reconstruct_image->rows);
 }

 #if defined(__cplusplus) || defined(c_plusplus)