% March 2001 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
}
status=CompareImagesCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)
}
status=CompositeImageCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)
}
status=ConvertImageCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)
}
status=IdentifyImageCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)
Image
*difference_image,
- *reference_image,
- *reconstruct_image;
+ *ping_image,
+ *reconstruct_image,
+ *reference_image;
MagickBooleanType
status;
j;
size_t
- length;
+ length,
+ test;
unsigned char
*blob;
- size_t
- test;
-
test=0;
(void) FormatLocaleFile(stdout,"validate image formats in memory:\n");
for (i=0; reference_formats[i].magick != (char *) NULL; i++)
(void) FormatLocaleString(reference_image->filename,MaxTextExtent,"%s:%s",
reference_formats[i].magick,output_filename);
status=SetImageType(reference_image,reference_types[j].type,exception);
- InheritException(exception,&reference_image->exception);
if (status == MagickFalse)
{
(void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
reference_image=DestroyImage(reference_image);
continue;
}
- status=SetImageDepth(reference_image,reference_types[j].depth);
- InheritException(exception,&reference_image->exception);
+ status=SetImageDepth(reference_image,reference_types[j].depth,exception);
if (status == MagickFalse)
{
(void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
continue;
}
/*
- Read reference image.
+ Ping reference image.
*/
(void) FormatLocaleString(image_info->filename,MaxTextExtent,"%s:%s",
reference_formats[i].magick,output_filename);
+ ping_image=PingImage(image_info,exception);
+ if (ping_image == (Image *) NULL)
+ {
+ (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
+ GetMagickModule());
+ (*fail)++;
+ continue;
+ }
+ ping_image=DestroyImage(ping_image);
+ /*
+ Read reference image.
+ */
reference_image=ReadImage(image_info,exception);
if (reference_image == (Image *) NULL)
{
reference_image=DestroyImage(reference_image);
continue;
}
+ /*
+ Ping reference blob.
+ */
+ ping_image=PingBlob(image_info,blob,length,exception);
+ if (ping_image == (Image *) NULL)
+ {
+ (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
+ GetMagickModule());
+ (*fail)++;
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
+ continue;
+ }
+ ping_image=DestroyImage(ping_image);
/*
Read reconstruct image.
*/
#if defined(MAGICKCORE_HDRI_SUPPORT)
fuzz+=0.003;
#endif
- if (IsRGBColorspace(reference_image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(reference_image->colorspace) == MagickFalse)
fuzz+=0.3;
fuzz+=MagickEpsilon;
difference_image=CompareImages(reference_image,reconstruct_image,
continue;
}
difference_image=DestroyImage(difference_image);
- if ((distortion/QuantumRange) > fuzz)
+ if ((QuantumScale*distortion) > fuzz)
{
(void) FormatLocaleFile(stdout,"... fail (with distortion %g).\n",
- distortion/QuantumRange);
+ QuantumScale*distortion);
(*fail)++;
continue;
}
(void) FormatLocaleString(reference_image->filename,MaxTextExtent,"%s:%s",
reference_formats[i].magick,output_filename);
status=SetImageType(reference_image,reference_types[j].type,exception);
- InheritException(exception,&reference_image->exception);
if (status == MagickFalse)
{
(void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
reference_image=DestroyImage(reference_image);
continue;
}
- status=SetImageDepth(reference_image,reference_types[j].depth);
- InheritException(exception,&reference_image->exception);
+ status=SetImageDepth(reference_image,reference_types[j].depth,exception);
if (status == MagickFalse)
{
(void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
#if defined(MAGICKCORE_HDRI_SUPPORT)
fuzz+=0.003;
#endif
- if (IsRGBColorspace(reference_image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(reference_image->colorspace) == MagickFalse)
fuzz+=0.3;
fuzz+=MagickEpsilon;
difference_image=CompareImages(reference_image,reconstruct_image,
continue;
}
difference_image=DestroyImage(difference_image);
- if ((distortion/QuantumRange) > fuzz)
+ if ((QuantumScale*distortion) > fuzz)
{
(void) FormatLocaleFile(stdout,"... fail (with distortion %g).\n",
- distortion/QuantumRange);
+ QuantumScale*distortion);
(*fail)++;
continue;
}
continue;
}
if (LocaleNCompare(reference_map[i],"cmy",3) == 0)
- (void) TransformImageColorspace(reference_image,CMYKColorspace);
+ (void) SetImageColorspace(reference_image,CMYKColorspace,exception);
length=strlen(reference_map[i])*reference_image->columns*
reference_image->rows*reference_storage[j].quantum;
pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels));
reference_image=DestroyImage(reference_image);
continue;
}
- (void) SetImageBackgroundColor(reference_image);
+ (void) SetImageBackgroundColor(reference_image,exception);
status=ImportImagePixels(reference_image,0,0,reference_image->columns,
reference_image->rows,reference_map[i],reference_storage[j].type,
pixels,exception);
/*
Read reconstruct image.
*/
- reconstruct_image=AcquireImage(image_info);
+ reconstruct_image=AcquireImage(image_info,exception);
(void) SetImageExtent(reconstruct_image,reference_image->columns,
reference_image->rows,exception);
(void) SetImageColorspace(reconstruct_image,reference_image->colorspace,
exception);
- (void) SetImageBackgroundColor(reconstruct_image);
+ (void) SetImageBackgroundColor(reconstruct_image,exception);
status=ImportImagePixels(reconstruct_image,0,0,reconstruct_image->columns,
reconstruct_image->rows,reference_map[i],reference_storage[j].type,
pixels,exception);
- InheritException(exception,&reconstruct_image->exception);
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
if (status == MagickFalse)
{
continue;
}
difference_image=DestroyImage(difference_image);
- if ((distortion/QuantumRange) > 0.0)
+ if ((QuantumScale*distortion) > 0.0)
{
(void) FormatLocaleFile(stdout,"... fail (with distortion %g).\n",
- distortion/QuantumRange);
+ QuantumScale*distortion);
(*fail)++;
continue;
}
}
status=MontageImageCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)
}
status=StreamImageCommand(image_info,number_arguments,arguments,
(char **) NULL,exception);
- for (j=0; j < number_arguments; j++)
+ for (j=0; j < (ssize_t) number_arguments; j++)
arguments[j]=DestroyString(arguments[j]);
arguments=(char **) RelinquishMagickMemory(arguments);
if (status != MagickFalse)