@@ -269,7 +269,6 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
269
269
status ;
270
270
271
271
MetricType
272
- distortion_metric = MeanSquaredErrorMetric ,
273
272
metric = UndefinedErrorMetric ;
274
273
275
274
RectangleInfo
@@ -1159,7 +1158,6 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
1159
1158
reconstruct_image = GetImageFromList (image ,1 );
1160
1159
offset .x = 0 ;
1161
1160
offset .y = 0 ;
1162
- distortion_metric = metric ;
1163
1161
if (subimage_search != MagickFalse )
1164
1162
{
1165
1163
char
@@ -1173,13 +1171,10 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
1173
1171
if (similarity_metric >= dissimilarity_threshold )
1174
1172
(void ) ThrowMagickException (exception ,GetMagickModule (),ImageWarning ,
1175
1173
"ImagesTooDissimilar" ,"`%s'" ,image -> filename );
1176
- if ((metric != AbsoluteErrorMetric ) &&
1177
- (metric != PeakSignalToNoiseRatioMetric ))
1178
- distortion_metric = MeanSquaredErrorMetric ;
1179
1174
}
1180
1175
if (similarity_image == (Image * ) NULL )
1181
- difference_image = CompareImageChannels (image ,reconstruct_image ,channels ,
1182
- distortion_metric , & distortion ,exception );
1176
+ difference_image = CompareImageChannels (image ,reconstruct_image ,channels ,metric ,
1177
+ & distortion ,exception );
1183
1178
else
1184
1179
{
1185
1180
Image
@@ -1190,8 +1185,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
1190
1185
*/
1191
1186
composite_image = CloneImage (image ,0 ,0 ,MagickTrue ,exception );
1192
1187
if (composite_image == (Image * ) NULL )
1193
- difference_image = CompareImageChannels (image ,reconstruct_image ,
1194
- channels , distortion_metric , & distortion ,exception );
1188
+ difference_image = CompareImageChannels (image ,reconstruct_image ,channels , metric ,
1189
+ & distortion ,exception );
1195
1190
else
1196
1191
{
1197
1192
Image
@@ -1202,8 +1197,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
1202
1197
1203
1198
(void ) CompositeImage (composite_image ,CopyCompositeOp ,
1204
1199
reconstruct_image ,offset .x ,offset .y );
1205
- difference_image = CompareImageChannels (image ,composite_image ,channels ,
1206
- distortion_metric , & distortion ,exception );
1200
+ difference_image = CompareImageChannels (image ,composite_image ,channels ,metric ,
1201
+ & distortion ,exception );
1207
1202
if (difference_image != (Image * ) NULL )
1208
1203
{
1209
1204
difference_image -> page .x = offset .x ;
@@ -1220,8 +1215,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
1220
1215
Image
1221
1216
* sans_image ;
1222
1217
1223
- sans_image = CompareImages (distort_image ,reconstruct_image ,
1224
- distortion_metric , & distortion ,exception );
1218
+ sans_image = CompareImages (distort_image ,reconstruct_image ,metric ,
1219
+ & distortion ,exception );
1225
1220
if (sans_image != (Image * ) NULL )
1226
1221
sans_image = DestroyImage (sans_image );
1227
1222
distort_image = DestroyImage (distort_image );
0 commit comments