From: cristy Date: Sat, 31 Dec 2011 20:10:15 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6484 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2cb5a98a29a8bc8e0171c84cf08455b152b7956;p=imagemagick --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 0c630bb70..f591a1fde 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -975,6 +975,7 @@ static MagickBooleanType UnoptimizedPixelCacheClone(CacheInfo *clone_info, } cache_offset=cache_info->offset; } +if (0) if ((cache_info->type != MemoryCache) && (clone_info->type != MemoryCache) && (strcmp(cache_info->cache_filename,clone_info->cache_filename) == 0)) { @@ -993,7 +994,6 @@ static MagickBooleanType UnoptimizedPixelCacheClone(CacheInfo *clone_info, } if (clone_info->type == DiskCache) { - (void) ClosePixelCacheOnDisk(clone_info); if (OpenPixelCacheOnDisk(clone_info,WriteMode) == MagickFalse) { if (cache_info->type == DiskCache) @@ -4156,7 +4156,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, if (cache_info->metacontent_extent != 0) cache_info->metacontent=(void *) (cache_info->pixels+ number_pixels*cache_info->number_channels); - if (source_info.storage_class != UndefinedClass) + if (source_info.type != UndefinedCache) { status=ClonePixelCachePixels(cache_info,&source_info, exception); @@ -4177,6 +4177,11 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, "CacheResourcesExhausted","`%s'",image->filename); return(MagickFalse); } + if (source_info.type != UndefinedCache) + { + (void) ClosePixelCacheOnDisk(cache_info); + *cache_info->cache_filename='\0'; + } if (OpenPixelCacheOnDisk(cache_info,mode) == MagickFalse) { RelinquishMagickResource(DiskResource,cache_info->length); @@ -4224,7 +4229,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, if (cache_info->metacontent_extent != 0) cache_info->metacontent=(void *) (cache_info->pixels+ number_pixels*cache_info->number_channels); - if (source_info.storage_class != UndefinedClass) + if (source_info.type != UndefinedCache) { status=ClonePixelCachePixels(cache_info,&source_info, exception); @@ -4249,7 +4254,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, RelinquishMagickResource(MapResource,cache_info->length); } status=MagickTrue; - if ((source_info.type != UndefinedCache) && (mode != ReadMode)) + if (source_info.type != UndefinedCache) { status=ClonePixelCachePixels(cache_info,&source_info,exception); RelinquishPixelCachePixels(&source_info); diff --git a/MagickCore/segment.c b/MagickCore/segment.c index 1af173421..a59285455 100644 --- a/MagickCore/segment.c +++ b/MagickCore/segment.c @@ -1833,6 +1833,7 @@ MagickExport MagickBooleanType SegmentImage(Image *image, /* Initialize histogram. */ + SyncImagePixelCache(image,exception); InitializeHistogram(image,histogram,exception); (void) OptimalTau(histogram[Red],Tau,0.2,DeltaTau, smooth_threshold == 0.0 ? 1.0 : smooth_threshold,extrema[Red]); diff --git a/MagickCore/signature.c b/MagickCore/signature.c index 43380d873..e44529023 100644 --- a/MagickCore/signature.c +++ b/MagickCore/signature.c @@ -539,8 +539,6 @@ MagickExport MagickBooleanType SignatureImage(Image *image, traits=GetPixelChannelMapTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - if ((traits & UpdatePixelTrait) == 0) - continue; pixel=QuantumScale*p[i]; for (j=0; j < (ssize_t) sizeof(pixel); j++) *q++=(unsigned char) (&pixel)[j]; diff --git a/PerlMagick/t/png/read-16.t b/PerlMagick/t/png/read-16.t index d15088860..e5c4ebde7 100644 --- a/PerlMagick/t/png/read-16.t +++ b/PerlMagick/t/png/read-16.t @@ -18,14 +18,14 @@ chdir 't/png' || die 'Cd failed'; # 1) Test Monochrome PNG # testRead( 'input_mono.png', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 2) Test 256 color pseudocolor PNG # ++$test; testRead( 'input_256.png', - 'c45a7f8b2d978f5d92f70ddc40e0a7fec30dc3243facdb293f2245952ed68de1' ); + '4404bce58d768dda28165b81ad6618e6fd6553996a44e62486f4d46c6ac7e593' ); # # 3) Test TrueColor PNG @@ -39,7 +39,7 @@ testRead( 'input_truecolor.png', # ++$test; testRead( 'input.mng', - 'ece756f9de4c618819cf88c8561630518a9cf39ce09a81bf7c78445d9f00e09d' ); + '70e2aabf6c94d5fb8660c3a4cec5ecce72f5b6b3f98a8617a2db5d3519db6ae0' ); # # 5) Test 16-bit Portable Network Graphics @@ -47,5 +47,5 @@ testRead( 'input.mng', ++$test; testRead( 'input_16.png', '6b6761c8108b1616e9411c4ef2564505715a37b93e86d2c824c9a4bca31bf47b', - '106f0647ae10a6516b1ab2968038161e287ef40d1b22ca047531ed768e594ef1'); + '5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee'); diff --git a/PerlMagick/t/png/read.t b/PerlMagick/t/png/read.t index 4e444889a..9a09593a3 100644 --- a/PerlMagick/t/png/read.t +++ b/PerlMagick/t/png/read.t @@ -19,7 +19,7 @@ chdir 't/png' || die 'Cd failed'; # print( "1-bit grayscale PNG ...\n" ); testRead( 'input_bw.png', - '5ace96fd545d2f4479f2e7a8f6f8f6cb1fd7cd277ae35559dffc825fd2a670f6' ); + 'fe660b68ebf6e851ed91840b8ff8b083fcf8a58f675c8d699516e01a9946d85a' ); # # 2) Test Monochrome PNG @@ -27,7 +27,7 @@ testRead( 'input_bw.png', ++$test; print( "8-bit grayscale PNG ...\n" ); testRead( 'input_mono.png', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 3) Test 16-bit Portable Network Graphics @@ -36,14 +36,14 @@ testRead( 'input_mono.png', print( "16-bit grayscale PNG ...\n" ); testRead( 'input_16.png', '6b6761c8108b1616e9411c4ef2564505715a37b93e86d2c824c9a4bca31bf47b', - '106f0647ae10a6516b1ab2968038161e287ef40d1b22ca047531ed768e594ef1' ); + '5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee' ); # # 4) Test 256 color pseudocolor PNG # ++$test; print( "8-bit indexed-color PNG ...\n" ); testRead( 'input_256.png', - 'c45a7f8b2d978f5d92f70ddc40e0a7fec30dc3243facdb293f2245952ed68de1' ); + '4404bce58d768dda28165b81ad6618e6fd6553996a44e62486f4d46c6ac7e593' ); # # 5) Test TrueColor PNG @@ -59,5 +59,5 @@ testRead( 'input_truecolor.png', ++$test; print( "MNG with 24-bit Truecolor PNGs...\n" ); testRead( 'input.mng', - 'ece756f9de4c618819cf88c8561630518a9cf39ce09a81bf7c78445d9f00e09d' ); + '70e2aabf6c94d5fb8660c3a4cec5ecce72f5b6b3f98a8617a2db5d3519db6ae0' ); diff --git a/PerlMagick/t/png/write-16.t b/PerlMagick/t/png/write-16.t index 01f7da67b..e3bd504a6 100644 --- a/PerlMagick/t/png/write-16.t +++ b/PerlMagick/t/png/write-16.t @@ -20,7 +20,7 @@ chdir 't/png' || die 'Cd failed'; testReadWrite( 'input_256.png', 'output_256.png', q/quality=>54/, - 'c45a7f8b2d978f5d92f70ddc40e0a7fec30dc3243facdb293f2245952ed68de1' ); + '4404bce58d768dda28165b81ad6618e6fd6553996a44e62486f4d46c6ac7e593' ); # # 2) Test truecolor image @@ -37,7 +37,7 @@ testReadWrite( 'input_truecolor.png', ++$test; testReadWrite( 'input_mono.png', 'output_mono.png', '', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 4) Test Multiple-image Network Graphics @@ -46,7 +46,7 @@ testReadWrite( 'input_mono.png', testReadWrite( 'input.mng', 'output.mng', q/quality=>55/, - 'ece756f9de4c618819cf88c8561630518a9cf39ce09a81bf7c78445d9f00e09d' ); + '70e2aabf6c94d5fb8660c3a4cec5ecce72f5b6b3f98a8617a2db5d3519db6ae0' ); # # 5) Test 16-bit Portable Network Graphics @@ -56,6 +56,6 @@ testReadWrite( 'input_16.png', 'output_16.png', q/quality=>55/, 'fa6b164245b385b3dea5764074be2c959a503dde90ecb1d4ba9c76a46bb8e4e6', - '106f0647ae10a6516b1ab2968038161e287ef40d1b22ca047531ed768e594ef1'); + '5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee'); diff --git a/PerlMagick/t/png/write.t b/PerlMagick/t/png/write.t index 9e35e2cfb..e245f83e0 100644 --- a/PerlMagick/t/png/write.t +++ b/PerlMagick/t/png/write.t @@ -19,7 +19,7 @@ chdir 't/png' || die 'Cd failed'; # print( "1-bit grayscale PNG ...\n" ); testReadWrite( 'input_bw.png', 'output_bw.png', q/quality=>95/, - '5ace96fd545d2f4479f2e7a8f6f8f6cb1fd7cd277ae35559dffc825fd2a670f6'); + 'fe660b68ebf6e851ed91840b8ff8b083fcf8a58f675c8d699516e01a9946d85a'); # # 2) Test monochrome image @@ -28,7 +28,7 @@ testReadWrite( 'input_bw.png', 'output_bw.png', q/quality=>95/, print( "8-bit grayscale PNG ...\n" ); testReadWrite( 'input_mono.png', 'output_mono.png', '', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846'); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4'); # # 3) Test 16-bit Portable Network Graphics # @@ -38,7 +38,7 @@ testReadWrite( 'input_16.png', 'output_16.png', q/quality=>55/, 'fa6b164245b385b3dea5764074be2c959a503dde90ecb1d4ba9c76a46bb8e4e6', - '106f0647ae10a6516b1ab2968038161e287ef40d1b22ca047531ed768e594ef1' ); + '5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee' ); # # 4) Test pseudocolor image # @@ -47,7 +47,7 @@ print( "8-bit indexed-color PNG ...\n" ); testReadWrite( 'input_256.png', 'output_256.png', q/quality=>54/, - 'c45a7f8b2d978f5d92f70ddc40e0a7fec30dc3243facdb293f2245952ed68de1' ); + '4404bce58d768dda28165b81ad6618e6fd6553996a44e62486f4d46c6ac7e593' ); # # 5) Test truecolor image # @@ -65,4 +65,4 @@ print( "MNG with 24-bit Truecolor PNGs ...\n" ); testReadWrite( 'input.mng', 'output.mng', q/quality=>55/, - 'ece756f9de4c618819cf88c8561630518a9cf39ce09a81bf7c78445d9f00e09d' ); + '70e2aabf6c94d5fb8660c3a4cec5ecce72f5b6b3f98a8617a2db5d3519db6ae0' ); diff --git a/PerlMagick/t/tiff/read.t b/PerlMagick/t/tiff/read.t index e6b05af19..f957e891a 100644 --- a/PerlMagick/t/tiff/read.t +++ b/PerlMagick/t/tiff/read.t @@ -27,7 +27,7 @@ testRead ( 'input_mono.tiff', ++$test; print("PseudoColor (16 color)...\n"); testRead( 'input_16.tiff', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 3) Test reading PseudoColor (16 color + matte channel) @@ -35,7 +35,7 @@ testRead( 'input_16.tiff', ++$test; print("PseudoColor (16 color + matte channel)...\n"); testRead( 'input_16_matte.tiff', - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 4) Test reading PseudoColor (256 color) @@ -43,7 +43,7 @@ testRead( 'input_16_matte.tiff', ++$test; print("PseudoColor (256 color) ...\n"); testRead( 'input_256.tiff', - '48113b47a70a1d8dc046327cb9c799ed265e5d76a5eb0495d142015c4bd44b23' ); + '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847' ); # # 5) Test reading PseudoColor (256 color + matte channel) @@ -51,7 +51,7 @@ testRead( 'input_256.tiff', ++$test; print("PseudoColor (256 color + matte channel) ...\n"); testRead( 'input_256_matte.tiff', - 'f50dea7da00ff27cc5fd5bc66bf0146b68b207ea7df919f72c4ccb02cb40f759' ); + 'f3dc959e76f722bbc0a4338e2ed6650d73be3a81774c55210118531333fe6daa' ); # # 6) Test reading PseudoColor using contiguous planar packing @@ -59,7 +59,7 @@ testRead( 'input_256_matte.tiff', ++$test; print("PseudoColor (256 color) contiguous planes ...\n"); testRead( 'input_256_planar_contig.tiff', - '48113b47a70a1d8dc046327cb9c799ed265e5d76a5eb0495d142015c4bd44b23' ); + '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847' ); # # 7) Test reading PseudoColor using seperate planes @@ -67,7 +67,7 @@ testRead( 'input_256_planar_contig.tiff', ++$test; print("PseudoColor (256 color) seperate planes ...\n"); testRead( 'input_256_planar_separate.tiff', - '48113b47a70a1d8dc046327cb9c799ed265e5d76a5eb0495d142015c4bd44b23' ); + '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847' ); # # 8) Test Reading TrueColor (8-bit) @@ -124,7 +124,7 @@ testRead( 'input_gray_8bit.tiff', ++$test; print("Grayscale (8-bit + matte) ...\n"); testRead( 'input_gray_8bit_matte.tiff', - '44cb1a46bd5a147f446b18cea8b07cfdf31acdc856029f95d91193add5c11b85' ); + 'e87923c84a9140824abbb3683d603c19e8b1b08b926d78f794c5ea813db53615' ); # # 15) Test Reading Grayscale 12-bit diff --git a/PerlMagick/t/tiff/write.t b/PerlMagick/t/tiff/write.t index 9818832b4..44a5b080f 100644 --- a/PerlMagick/t/tiff/write.t +++ b/PerlMagick/t/tiff/write.t @@ -21,7 +21,7 @@ print("PseudoColor image (4 bits/sample) ...\n"); testReadWrite( 'input_16.tiff', 'output_16.tiff', q//, - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846'); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4'); # # 2) Test 8-bit pseudocolor image @@ -31,7 +31,7 @@ print("PseudoColor image (8 bits/sample) ...\n"); testReadWrite( 'input_256.tiff', 'output_256.tiff', q//, - '48113b47a70a1d8dc046327cb9c799ed265e5d76a5eb0495d142015c4bd44b23'); + '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847'); # # 3) Test 4-bit pseudocolor + matte channel image @@ -41,7 +41,7 @@ print("PseudoColor image (4 bits/sample + matte channel) ...\n"); testReadWrite( 'input_16_matte.tiff', 'output_16_matte.tiff', q//, - '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' ); + '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); # # 4) Test 8-bit pseudocolor + matte channel image @@ -51,7 +51,7 @@ print("PseudoColor image (8 bits/sample + matte channel) ...\n"); testReadWrite( 'input_256_matte.tiff', 'output_256_matte.tiff', q//, - 'f50dea7da00ff27cc5fd5bc66bf0146b68b207ea7df919f72c4ccb02cb40f759' ); + 'f3dc959e76f722bbc0a4338e2ed6650d73be3a81774c55210118531333fe6daa' ); # # 5) Test truecolor image @@ -101,7 +101,7 @@ print("Gray image (4 bits per sample + matte channel) ...\n"); testReadWrite( 'input_gray_4bit_matte.tiff', 'output_gray_4bit_matte.tiff', q//, - '44cb1a46bd5a147f446b18cea8b07cfdf31acdc856029f95d91193add5c11b85' ); + 'be4a2a4e26725e6bfd9d55ef44cdc6f6bc0808922676ff048f3a9df55a79a26b' ); # # 10) Test gray 8 bit image (with matte channel) @@ -111,4 +111,4 @@ print("Gray image (8 bits per sample + matte channel) ...\n"); testReadWrite( 'input_gray_8bit_matte.tiff', 'output_gray_8bit_matte.tiff', q//, - '44cb1a46bd5a147f446b18cea8b07cfdf31acdc856029f95d91193add5c11b85' ); + 'e87923c84a9140824abbb3683d603c19e8b1b08b926d78f794c5ea813db53615' ); diff --git a/PerlMagick/t/write.t b/PerlMagick/t/write.t index a32432d25..97ffa86d4 100644 --- a/PerlMagick/t/write.t +++ b/PerlMagick/t/write.t @@ -29,14 +29,14 @@ print("AVS X image file ...\n"); testReadWrite( 'AVS:input.avs', 'AVS:output.avs', q//, - '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); + 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3'); print("Microsoft Windows bitmap image file ...\n"); ++$test; testReadWrite( 'BMP:input.bmp', 'BMP:output.bmp', q//, - '32d82b4ab7a2527d0b886ccdd60990f6f7e4a411181337bd033760256c0d596c'); + 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39'); print("Microsoft Windows 24-bit bitmap image file ...\n"); ++$test; @@ -45,7 +45,6 @@ testReadWrite( 'BMP:input.bmp24', q//, '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); - print("ZSoft IBM PC multi-page Paintbrush file ...\n"); ++$test; testReadWrite( 'DCX:input.dcx', @@ -72,14 +71,14 @@ print("CompuServe graphics interchange format ...\n"); testReadWrite( 'GIF:input.gif', 'GIF:output.gif', q//, - '32d82b4ab7a2527d0b886ccdd60990f6f7e4a411181337bd033760256c0d596c'); + 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39'); print("CompuServe graphics interchange format (1987) ...\n"); ++$test; testReadWrite( 'GIF87:input.gif87', 'GIF87:output.gif87', q//, - 'd8938f29cbd56aa164bf8265f385d9ec872be75fe08401601b68eee159df8cd9'); + 'a037bce490abf358b3c8e1f471a83d15434da26d6c91aa6d761407c0df573f1d'); print("Magick image file format ...\n"); ++$test; @@ -170,14 +169,14 @@ print("SUN 1-bit Rasterfile ...\n"); testReadWrite( 'SUN:input.im1', 'SUN:output.im1', q//, - '31d166e543d44963cc8a500212ae60c1c6f040fac3117748bcd54174727b45e1'); + 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd'); print("SUN 8-bit Rasterfile ...\n"); ++$test; testReadWrite( 'SUN:input.im8', 'SUN:output.im8', q//, - '88528b9fde504a6388f0db5a351e3373ea15607e18a0c2d0e7e0fe4c851cce10'); + '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8'); print("SUN True-Color Rasterfile ...\n"); ++$test; @@ -201,7 +200,7 @@ testReadWrite( 'VIFF:input.viff', 'VIFF:output.viff', q//, '7f2c98e7ce98983509580eaeb3bb6a420e3f358b39fcec4cdd96982ae1e21882', - '409e646b6ba024c597a6b2c34754bf23713857e367047e7ea15615d8bd0fd028', + 'bbeaa063bd13c74414a9962f21a795844661b596bd89f753f064ba1db2624d03', 'aa4a6154f3c314d99c257280faf9097f3863a132ec8bddbc3b68209ce2c19487'); print("WBMP (Wireless Bitmap (level 0) image) ...\n"); @@ -210,7 +209,7 @@ testReadWrite( 'WBMP:input.wbmp', 'WBMP:output.wbmp', q//, 'b7b682361e82d9d7cf2bed34f76af87576b97590b12d76b961104e53ee18ee74', - 'd386466607cfcec0625943f277454d66cce1d17696d482f50103a25a04bd1070', + '6d1374fa22aa5cb8fa9e98b928b8dea6e5fc6606ed2dc07c5f27d1e03e494d0e', 'd818195f73f8d5db624c8f87a706bbcb3179dbb7a7f08abbad5b12cd97de8fe6'); print("X Windows system bitmap (black and white only) ...\n"); @@ -218,14 +217,14 @@ print("X Windows system bitmap (black and white only) ...\n"); testReadWrite( 'XBM:input.xbm', 'XBM:output.xbm', q//, - '31d166e543d44963cc8a500212ae60c1c6f040fac3117748bcd54174727b45e1'); + 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd'); print("X Windows system pixmap file (color) ...\n"); ++$test; testReadWrite( 'XPM:input.xpm', 'XPM:output.xpm', q//, - '88528b9fde504a6388f0db5a351e3373ea15607e18a0c2d0e7e0fe4c851cce10'); + '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8'); print("CMYK format ...\n"); ++$test; @@ -262,6 +261,6 @@ testReadWriteSized( 'RGBA:input_70x46.rgba', '70x46', 8, q//, - '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33' ); + 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3' ); 1;