From 7998e5fecd99cd9838e7a960168f48b92d38bbfc Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 8 Oct 2009 02:45:33 +0000 Subject: [PATCH] --- tests/validate.c | 20 +++- tests/validate.h | 283 +++++++++++++++++++++++++---------------------- 2 files changed, 162 insertions(+), 141 deletions(-) diff --git a/tests/validate.c b/tests/validate.c index 7e31bdfeb..77f424913 100644 --- a/tests/validate.c +++ b/tests/validate.c @@ -479,9 +479,11 @@ static unsigned long ValidateImageFormatsInMemory(ImageInfo *image_info, Generate reference image. */ CatchException(exception); - (void) fprintf(stdout," test %lu: %s/%s/%lu-bits",test++, - reference_formats[i].magick,MagickOptionToMnemonic(MagickTypeOptions, - reference_types[j].type),reference_types[j].depth); + (void) fprintf(stdout," test %lu: %s/%s/%s/%lu-bits",test++, + reference_formats[i].magick,MagickOptionToMnemonic( + MagickCompressOptions,reference_formats[i].compression), + MagickOptionToMnemonic(MagickTypeOptions,reference_types[j].type), + reference_types[j].depth); (void) CopyMagickString(image_info->filename,reference_filename, MaxTextExtent); reference_image=ReadImage(image_info,exception); @@ -518,6 +520,7 @@ static unsigned long ValidateImageFormatsInMemory(ImageInfo *image_info, reference_image=DestroyImage(reference_image); continue; } + reference_image->compression=reference_formats[i].compression; status=WriteImage(image_info,reference_image); InheritException(exception,&reference_image->exception); reference_image=DestroyImage(reference_image); @@ -547,6 +550,7 @@ static unsigned long ValidateImageFormatsInMemory(ImageInfo *image_info, (void) CopyMagickString(image_info->magick,reference_formats[i].magick, MaxTextExtent); reference_image->depth=reference_types[j].depth; + reference_image->compression=reference_formats[i].compression; length=8192; blob=ImageToBlob(image_info,reference_image,&length,exception); if (blob == (unsigned char *) NULL) @@ -685,9 +689,11 @@ static unsigned long ValidateImageFormatsOnDisk(ImageInfo *image_info, Generate reference image. */ CatchException(exception); - (void) fprintf(stdout," test %lu: %s/%s/%lu-bits",test++, - reference_formats[i].magick,MagickOptionToMnemonic(MagickTypeOptions, - reference_types[j].type),reference_types[j].depth); + (void) fprintf(stdout," test %lu: %s/%s/%s/%lu-bits",test++, + reference_formats[i].magick,MagickOptionToMnemonic( + MagickCompressOptions,reference_formats[i].compression), + MagickOptionToMnemonic(MagickTypeOptions,reference_types[j].type), + reference_types[j].depth); (void) CopyMagickString(image_info->filename,reference_filename, MaxTextExtent); reference_image=ReadImage(image_info,exception); @@ -724,6 +730,7 @@ static unsigned long ValidateImageFormatsOnDisk(ImageInfo *image_info, reference_image=DestroyImage(reference_image); continue; } + reference_image->compression=reference_formats[i].compression; status=WriteImage(image_info,reference_image); InheritException(exception,&reference_image->exception); reference_image=DestroyImage(reference_image); @@ -751,6 +758,7 @@ static unsigned long ValidateImageFormatsOnDisk(ImageInfo *image_info, (void) FormatMagickString(reference_image->filename,MaxTextExtent,"%s:%s", reference_formats[i].magick,output_filename); reference_image->depth=reference_types[j].depth; + reference_image->compression=reference_formats[i].compression; status=WriteImage(image_info,reference_image); InheritException(exception,&reference_image->exception); if (status == MagickFalse) diff --git a/tests/validate.h b/tests/validate.h index 501854e76..7de20d898 100644 --- a/tests/validate.h +++ b/tests/validate.h @@ -225,6 +225,9 @@ struct ReferenceFormats const char *magick; + CompressionType + compression; + double fuzz; }; @@ -232,145 +235,155 @@ struct ReferenceFormats static const struct ReferenceFormats reference_formats[] = { - { "AI", 0.0 }, - { "ART", 0.0 }, - { "AVS", 0.0 }, - { "BMP", 0.0 }, - { "CIN", 0.0 }, - { "CMYK", 0.0 }, - { "CMYKA", 0.0 }, - { "CUT", 0.0 }, - { "DCM", 0.0 }, - { "DCR", 0.0 }, - { "DCX", 0.0 }, - { "DDS", 0.0 }, - { "DFONT", 0.0 }, - { "DJVU", 0.0 }, - { "DNG", 0.0 }, - { "DOT", 0.0 }, - { "DPS", 0.0 }, - { "DPX", 0.0 }, - { "ERF", 0.0 }, - { "EXR", 0.0 }, - { "FITS", 0.003 }, - { "FPX", 0.0 }, - { "FRACTAL", 0.0 }, - { "FTS", 0.003 }, - { "GIF", 0.0 }, - { "GIF87", 0.0 }, - { "GRAY", 0.0 }, - { "HTM", 0.0 }, - { "HRZ", 0.0 }, - { "HTML", 0.0 }, - { "ICB", 0.0 }, - { "ICO", 0.0 }, - { "ICON", 0.0 }, - { "INFO", 0.0 }, - { "INLINE", 0.0 }, - { "JBG", 0.0 }, - { "JNG", 0.003 }, - { "JP2", 0.3 }, - { "JPC", 0.0 }, - { "JPEG", 0.003 }, - { "JPG", 0.003 }, - { "K25", 0.0 }, - { "KDC", 0.0 }, - { "MAT", 0.0 }, - { "MATTE", 0.0 }, - { "MIFF", 0.0 }, - { "MNG", 0.0 }, - { "MONO", 0.0 }, - { "MOV", 0.0 }, - { "MRW", 0.0 }, - { "MTV", 0.0 }, - { "NEF", 0.0 }, - { "ORF", 0.0 }, - { "OTB", 0.0 }, - { "OTF", 0.0 }, - { "PAL", 0.0 }, - { "PAM", 0.0 }, - { "PBM", 0.0 }, - { "PCT", 0.003 }, - { "PCX", 0.0 }, - { "PEF", 0.0 }, - { "PFA", 0.0 }, - { "PFB", 0.0 }, - { "PFM", 0.0 }, - { "PGM", 0.0 }, - { "PGX", 0.0 }, - { "PICT", 0.003 }, - { "PIX", 0.0 }, - { "PJPEG", 0.003 }, - { "PLASMA", 0.0 }, - { "PNG", 0.0 }, - { "PNG24", 0.0 }, - { "PNG32", 0.0 }, - { "PNM", 0.0 }, - { "PPM", 0.0 }, - { "PREVIEW", 0.0 }, - { "PTIF", 0.0 }, - { "PWP", 0.0 }, - { "RADIAL-GR", 0.0 }, - { "RAF", 0.0 }, - { "RAS", 0.0 }, - { "RGB", 0.0 }, - { "RGBA", 0.003 }, - { "RGBO", 0.0 }, - { "RLA", 0.0 }, - { "RLE", 0.0 }, - { "SCR", 0.0 }, - { "SCT", 0.0 }, - { "SFW", 0.0 }, - { "SGI", 0.0 }, - { "SHTML", 0.0 }, - { "SR2", 0.0 }, - { "SRF", 0.0 }, - { "STEGANO", 0.0 }, - { "SUN", 0.0 }, - { "TGA", 0.0 }, - { "TIFF", 0.0 }, - { "TIFF64", 0.0 }, - { "TILE", 0.0 }, - { "TIM", 0.0 }, - { "TTC", 0.0 }, - { "TTF", 0.0 }, - { "TXT", 0.0 }, - { "UIL", 0.0 }, - { "UYVY", 0.0 }, - { "VDA", 0.0 }, - { "VICAR", 0.0 }, - { "VIFF", 0.0 }, - { "VST", 0.0 }, - { "WBMP", 0.0 }, - { "WPG", 0.0 }, - { "X3F", 0.0 }, - { "XBM", 0.0 }, - { "XCF", 0.0 }, - { "XPM", 0.0 }, - { "XPS", 0.0 }, - { "XV", 0.0 }, + { "AI", UndefinedCompression, 0.0 }, + { "ART", UndefinedCompression, 0.0 }, + { "AVS", UndefinedCompression, 0.0 }, + { "BMP", UndefinedCompression, 0.0 }, + { "CIN", UndefinedCompression, 0.0 }, + { "CMYK", UndefinedCompression, 0.0 }, + { "CMYKA", UndefinedCompression, 0.0 }, + { "CUT", UndefinedCompression, 0.0 }, + { "DCM", UndefinedCompression, 0.0 }, + { "DCR", UndefinedCompression, 0.0 }, + { "DCX", UndefinedCompression, 0.0 }, + { "DDS", UndefinedCompression, 0.0 }, + { "DFONT", UndefinedCompression, 0.0 }, + { "DJVU", UndefinedCompression, 0.0 }, + { "DNG", UndefinedCompression, 0.0 }, + { "DOT", UndefinedCompression, 0.0 }, + { "DPS", UndefinedCompression, 0.0 }, + { "DPX", UndefinedCompression, 0.0 }, + { "ERF", UndefinedCompression, 0.0 }, + { "EXR", UndefinedCompression, 0.0 }, + { "FITS", UndefinedCompression, 0.003 }, + { "FPX", UndefinedCompression, 0.0 }, + { "FRACTAL", UndefinedCompression, 0.0 }, + { "FTS", UndefinedCompression, 0.003 }, + { "GIF", UndefinedCompression, 0.0 }, + { "GIF87", UndefinedCompression, 0.0 }, + { "GRAY", UndefinedCompression, 0.0 }, + { "HTM", UndefinedCompression, 0.0 }, + { "HRZ", UndefinedCompression, 0.0 }, + { "HTML", UndefinedCompression, 0.0 }, + { "ICB", UndefinedCompression, 0.0 }, + { "ICO", UndefinedCompression, 0.0 }, + { "ICON", UndefinedCompression, 0.0 }, + { "INFO", UndefinedCompression, 0.0 }, + { "INLINE", UndefinedCompression, 0.0 }, + { "JBG", UndefinedCompression, 0.0 }, + { "JNG", UndefinedCompression, 0.003 }, + { "JP2", UndefinedCompression, 0.3 }, + { "JPC", UndefinedCompression, 0.0 }, + { "JPEG", UndefinedCompression, 0.003 }, + { "JPG", UndefinedCompression, 0.003 }, + { "K25", UndefinedCompression, 0.0 }, + { "KDC", UndefinedCompression, 0.0 }, + { "MAT", UndefinedCompression, 0.0 }, + { "MATTE", UndefinedCompression, 0.0 }, + { "MIFF", UndefinedCompression, 0.0 }, + { "MNG", UndefinedCompression, 0.0 }, + { "MONO", UndefinedCompression, 0.0 }, + { "MOV", UndefinedCompression, 0.0 }, + { "MRW", UndefinedCompression, 0.0 }, + { "MTV", UndefinedCompression, 0.0 }, + { "NEF", UndefinedCompression, 0.0 }, + { "ORF", UndefinedCompression, 0.0 }, + { "OTB", UndefinedCompression, 0.0 }, + { "OTF", UndefinedCompression, 0.0 }, + { "PAL", UndefinedCompression, 0.0 }, + { "PAM", UndefinedCompression, 0.0 }, + { "PBM", UndefinedCompression, 0.0 }, + { "PCT", UndefinedCompression, 0.003 }, + { "PCX", UndefinedCompression, 0.0 }, + { "PEF", UndefinedCompression, 0.0 }, + { "PFA", UndefinedCompression, 0.0 }, + { "PFB", UndefinedCompression, 0.0 }, + { "PFM", UndefinedCompression, 0.0 }, + { "PGM", UndefinedCompression, 0.0 }, + { "PGX", UndefinedCompression, 0.0 }, + { "PICT", UndefinedCompression, 0.003 }, + { "PIX", UndefinedCompression, 0.0 }, + { "PJPEG", UndefinedCompression, 0.003 }, + { "PLASMA", UndefinedCompression, 0.0 }, + { "PNG", UndefinedCompression, 0.0 }, + { "PNG24", UndefinedCompression, 0.0 }, + { "PNG32", UndefinedCompression, 0.0 }, + { "PNM", UndefinedCompression, 0.0 }, + { "PPM", UndefinedCompression, 0.0 }, + { "PREVIEW", UndefinedCompression, 0.0 }, + { "PTIF", UndefinedCompression, 0.0 }, + { "PWP", UndefinedCompression, 0.0 }, + { "RADIAL-GR", UndefinedCompression, 0.0 }, + { "RAF", UndefinedCompression, 0.0 }, + { "RAS", UndefinedCompression, 0.0 }, + { "RGB", UndefinedCompression, 0.0 }, + { "RGBA", UndefinedCompression, 0.003 }, + { "RGBO", UndefinedCompression, 0.0 }, + { "RLA", UndefinedCompression, 0.0 }, + { "RLE", UndefinedCompression, 0.0 }, + { "SCR", UndefinedCompression, 0.0 }, + { "SCT", UndefinedCompression, 0.0 }, + { "SFW", UndefinedCompression, 0.0 }, + { "SGI", UndefinedCompression, 0.0 }, + { "SHTML", UndefinedCompression, 0.0 }, + { "SR2", UndefinedCompression, 0.0 }, + { "SRF", UndefinedCompression, 0.0 }, + { "STEGANO", UndefinedCompression, 0.0 }, + { "SUN", UndefinedCompression, 0.0 }, + { "TGA", UndefinedCompression, 0.0 }, + { "TIFF", UndefinedCompression, 0.0 }, + { "TIFF64", UndefinedCompression, 0.0 }, + { "TILE", UndefinedCompression, 0.0 }, + { "TIM", UndefinedCompression, 0.0 }, + { "TTC", UndefinedCompression, 0.0 }, + { "TTF", UndefinedCompression, 0.0 }, + { "TXT", UndefinedCompression, 0.0 }, + { "UIL", UndefinedCompression, 0.0 }, + { "UYVY", UndefinedCompression, 0.0 }, + { "VDA", UndefinedCompression, 0.0 }, + { "VICAR", UndefinedCompression, 0.0 }, + { "VIFF", UndefinedCompression, 0.0 }, + { "VST", UndefinedCompression, 0.0 }, + { "WBMP", UndefinedCompression, 0.0 }, + { "WPG", UndefinedCompression, 0.0 }, + { "X3F", UndefinedCompression, 0.0 }, + { "XBM", UndefinedCompression, 0.0 }, + { "XCF", UndefinedCompression, 0.0 }, + { "XPM", UndefinedCompression, 0.0 }, + { "XPS", UndefinedCompression, 0.0 }, + { "XV", UndefinedCompression, 0.0 }, #if !defined(__WINDOWS__) - { "XWD", 0.0 }, + { "XWD", UndefinedCompression, 0.0 }, #endif - { "YUV", 0.0 }, - { "YCbCr", 0.0 }, - { "YCbCrA", 0.0 }, + { "YUV", UndefinedCompression, 0.0 }, + { "YCbCr", UndefinedCompression, 0.0 }, + { "YCbCrA", UndefinedCompression, 0.0 }, #if defined(MAGICKCORE_GS_DELEGATE) - { "EPDF", 0.0 }, - { "EPI", 0.0 }, - { "EPS", 0.0 }, - { "EPS2", 0.0 }, - { "EPS3", 0.0 }, - { "EPSF", 0.0 }, - { "EPSI", 0.0 }, - { "EPT", 0.0 }, - { "PDF", 0.0 }, - { "PDFA", 0.0 }, - { "PS", 0.0 }, - { "PS2", 0.0 }, - { "PS3", 0.0 }, + { "EPDF", UndefinedCompression, 0.0 }, + { "EPI", UndefinedCompression, 0.0 }, + { "EPS", UndefinedCompression, 0.0 }, + { "EPS2", UndefinedCompression, 0.0 }, + { "EPS3", UndefinedCompression, 0.0 }, + { "EPSF", UndefinedCompression, 0.0 }, + { "EPSI", UndefinedCompression, 0.0 }, + { "EPT", UndefinedCompression, 0.0 }, + { "PDF", UndefinedCompression, 0.0 }, + { "PDF", ZipCompression, 0.0 }, + { "PDF", FaxCompression, 0.0 }, + { "PDF", JPEGCompression, 0.003 }, + { "PDF", RLECompression, 0.0 }, + { "PDF", LZWCompression, 0.0 }, + { "PDFA", UndefinedCompression, 0.0 }, + { "PS", UndefinedCompression, 0.0 }, + { "PS2", UndefinedCompression, 0.0 }, + { "PS3", UndefinedCompression, 0.0 }, + { "PS3", ZipCompression, 0.0 }, + { "PS3", FaxCompression, 0.0 }, + { "PS3", JPEGCompression, 0.003 }, + { "PS3", RLECompression, 0.0 }, + { "PS3", LZWCompression, 0.0 }, #endif - { (const char *) NULL, 0.0 } + { (const char *) NULL, UndefinedCompression, 0.0 } }; static const char -- 2.50.1