Skip to content

Commit 18ceb02

Browse files
author
Cristy
committed
PHASH should trap for equal size image for subimage-search
1 parent 4793fa4 commit 18ceb02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

wand/compare.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
12431243
if (((subimage_search != MagickFalse) &&
12441244
(image->columns == reconstruct_image->columns) &&
12451245
(image->rows == reconstruct_image->rows)) &&
1246-
(fabs(maxima-minima) < MagickEpsilon))
1246+
((fabs(maxima-minima) < MagickEpsilon) ||
1247+
(metric == PerceptualHashErrorMetric)))
12471248
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
12481249
"metric for subimage search is not sufficiently robust","(%s)",
12491250
CommandOptionToMnemonic(MagickMetricOptions,(ssize_t) metric));

0 commit comments

Comments
 (0)