From: Glenn Randers-Pehrson Date: Tue, 25 Jul 2017 00:51:15 +0000 (-0400) Subject: Removed png_write_chunk_from_profile() X-Git-Tag: 7.0.6-4~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75c5be1d5c7b29afc2e2e524ced49556b19427fb;p=imagemagick Removed png_write_chunk_from_profile() --- diff --git a/ChangeLog b/ChangeLog index 2b8c70d08..4589711f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2017-07-24 7.0.6-4 Glenn Randers-Pehrson - * Temporarily removed write_chunk_from_profile() from coders/png.c - because it has not worked at least since version 6.7.6. + * Removed write_chunk_from_profile() from coders/png.c because it has + not worked at least since version 6.7.6. 2017-07-24 7.0.6-3 Cristy * Release ImageMagick version 7.0.6-3, GIT revision 20598:cc9c43b44:20170724. diff --git a/coders/png.c b/coders/png.c index c875e06f9..427db5974 100644 --- a/coders/png.c +++ b/coders/png.c @@ -8015,59 +8015,6 @@ Magick_png_write_raw_profile(const ImageInfo *image_info,png_struct *ping, png_free(ping,text); } -#if 0 /* This has not worked since 6.7.6 or earlier */ -static MagickBooleanType Magick_png_write_chunk_from_profile(Image *image, - const char *string, MagickBooleanType logging) -{ - char - *name; - - const StringInfo - *profile; - - unsigned char - *data; - - png_uint_32 length; - - ResetImageProfileIterator(image); - - for (name=GetNextImageProfile(image); name != (const char *) NULL; ) - { - profile=GetImageProfile(image,name); - - if (profile != (const StringInfo *) NULL) - { - StringInfo - *ping_profile; - - if (LocaleNCompare(name,string,11) == 0) - { - if (logging != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Found %s profile",name); - - ping_profile=CloneStringInfo(profile); - data=GetStringInfoDatum(ping_profile), - length=(png_uint_32) GetStringInfoLength(ping_profile); - data[4]=data[3]; - data[3]=data[2]; - data[2]=data[1]; - data[1]=data[0]; - (void) WriteBlobMSBULong(image,length-5); /* data length */ - (void) WriteBlob(image,length-1,data+1); - (void) WriteBlobMSBULong(image,crc32(0,data+1,(uInt) length-1)); - ping_profile=DestroyStringInfo(ping_profile); - } - } - - name=GetNextImageProfile(image); - } - - return(MagickTrue); -} -#endif - static inline MagickBooleanType Magick_png_color_equal(const Image *image, const Quantum *p, const PixelInfo *q) { @@ -11049,18 +10996,8 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, } } -#if 0 /* This has not worked since 6.7.6 or earlier */ - /* write any png-chunk-b profiles */ - (void) Magick_png_write_chunk_from_profile(image,"PNG-chunk-b",logging); -#endif - png_write_info(ping,ping_info); -#if 0 /* This has not worked since 6.7.6 or earlier */ - /* write any PNG-chunk-m profiles */ - (void) Magick_png_write_chunk_from_profile(image,"PNG-chunk-m",logging); -#endif - ping_wrote_caNv = MagickFalse; /* write caNv chunk */ @@ -11564,11 +11501,6 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, } } -#if 0 /* This has not worked since 6.7.6 or earlier */ - /* write any PNG-chunk-e profiles */ - (void) Magick_png_write_chunk_from_profile(image,"PNG-chunk-e",logging); -#endif - /* write eXIf profile */ if (ping_have_eXIf != MagickFalse && ping_exclude_eXIf == MagickFalse) { @@ -11842,32 +11774,6 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, % is not intended for external use. It is only used internally by the % PNG encoder to inform the JNG encoder of the depth of the alpha channel. % -#if 0 - - This has not worked since 6.7.6 or earlier - To do: Perhaps it can be redesigned to use - -define PNG-chunk-x= instead -% -% It is possible to request that the PNG encoder write previously-formatted -% ancillary chunks in the output PNG file, using the "-profile" commandline -% option as shown below or by setting the profile via a programming -% interface: -% -% -profile PNG-chunk-x: -% -% where x is a location flag and is a file containing the chunk -% name in the first 4 bytes, then a colon (":"), followed by the chunk data. -% This encoder will compute the chunk length and CRC, so those must not -% be included in the file. -% -% "x" can be "b" (before PLTE), "m" (middle, i.e., between PLTE and IDAT), -% or "e" (end, i.e., after IDAT). If you want to write multiple chunks -% of the same type, then add a short unique string after the "x" to prevent -% subsequent profiles from overwriting the preceding ones, e.g., -% -% -profile PNG-chunk-b01:file01 -profile PNG-chunk-b02:file02 -#endif -% % As of version 6.6.6 the following optimizations are always done: % % o 32-bit depth is reduced to 16. @@ -12820,11 +12726,6 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, " JNG alpha interlace:%5d",0); } -#if 0 /* This has not worked since 6.7.6 or earlier */ - /* Write any JNG-chunk-b profiles */ - (void) Magick_png_write_chunk_from_profile(image,"JNG-chunk-b",logging); -#endif - /* Write leading ancillary chunks */ @@ -13132,11 +13033,6 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, jpeg_image_info=DestroyImageInfo(jpeg_image_info); blob=(unsigned char *) RelinquishMagickMemory(blob); -#if 0 /* This has not worked since 6.7.6 or earlier */ - /* Write any JNG-chunk-e profiles */ - (void) Magick_png_write_chunk_from_profile(image,"JNG-chunk-e",logging); -#endif - /* Write IEND chunk */ (void) WriteBlobMSBULong(image,0L); PNGType(chunk,mng_IEND);