mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-06-12 15:37:14 +02:00
push a notification for some edge case metrics
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user