correct distortion computation

This commit is contained in:
Cristy
2025-05-18 15:45:04 -04:00
parent 7dc67c3fc0
commit fc2799a3c8
3 changed files with 3 additions and 9 deletions
+3 -3
View File
@@ -1171,9 +1171,6 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
FinalizeImageSettings(image_info,image,MagickTrue);
if ((image == (Image *) NULL) || (GetImageListLength(image) < 2))
ThrowCompareException(OptionError,"MissingAnImageFilename",argv[i]);
if ((metric == MeanSquaredErrorMetric) ||
(metric == PeakSignalToNoiseRatioErrorMetric))
distortion_metric=metric;
image=GetImageFromList(image,0);
reconstruct_image=GetImageFromList(image,1);
offset.x=0;
@@ -1187,6 +1184,9 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
if (similarity_metric >= dissimilarity_threshold)
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
"ImagesTooDissimilar","`%s'",image->filename);
if ((metric == AbsoluteErrorMetric) ||
(metric == PeakSignalToNoiseRatioErrorMetric))
distortion_metric=metric;
}
if (similarity_image == (Image *) NULL)
difference_image=CompareImages(image,reconstruct_image,distortion_metric,
-3
View File
@@ -7974,9 +7974,6 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
if (option != (const char *) NULL)
metric=(MetricType) ParseCommandOption(MagickMetricOptions,
MagickFalse,option);
if ((metric != MeanSquaredErrorMetric) &&
(metric != PeakSignalToNoiseRatioErrorMetric))
metric=MeanSquaredErrorMetric;
difference_image=CompareImages(image,reconstruct_image,metric,
&distortion,exception);
if (difference_image == (Image *) NULL)
-3
View File
@@ -4003,9 +4003,6 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
if (option != (const char *) NULL)
metric=(MetricType) ParseCommandOption(MagickMetricOptions,
MagickFalse,option);
if ((metric != AbsoluteErrorMetric) &&
(metric != PeakSignalToNoiseRatioErrorMetric))
metric=MeanSquaredErrorMetric;
new_images=CompareImages(image,reconstruct_image,metric,&distortion,
_exception);
(void) distortion;