push a notification for some edge case metrics

This commit is contained in:
Cristy
2025-04-26 12:41:22 -04:00
parent 3644bdb326
commit 67cc338df3
2 changed files with 7 additions and 8 deletions
-8
View File
@@ -174,14 +174,6 @@ MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image,
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
*distortion=0.0;
if ((metric == DotProductCorrelationErrorMetric) ||
(metric == PhaseCorrelationErrorMetric))
{
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateError,"DelegateLibrarySupportNotBuiltIn",
"'%s' (DPC/Phase metrics require HDRI/FFT delegates)",image->filename);
return((Image *) NULL);
}
status=GetImageDistortion(image,reconstruct_image,metric,distortion,
exception);
if (status == MagickFalse)
+7
View File
@@ -1266,8 +1266,15 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
similarity_metric=fabs(similarity_metric);
break;
}
case PeakAbsoluteErrorMetric:
case PerceptualHashErrorMetric:
{
if ((subimage_search != MagickFalse) &&
(image->columns == reconstruct_image->columns) &&
(image->rows == reconstruct_image->rows))
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
"subimage search is not sufficiently robust for PAE/PHASH metrics",
"`%s'",image->filename);
if (distortion == INFINITY)
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
"images have no discernible similarity","`%s'",image->filename);