From 5c7cf4e469a4dad7e277783749155932252c52df Mon Sep 17 00:00:00 2001 From: glennrp Date: Fri, 24 Dec 2010 00:30:00 +0000 Subject: [PATCH] Get both Property and Artifact directives in coders/png.c --- coders/png.c | 20 ++++++++++++++++++-- magick/image.c | 3 --- wand/mogrify.c | 8 -------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/coders/png.c b/coders/png.c index 78fc4a1cd..0c7a61999 100644 --- a/coders/png.c +++ b/coders/png.c @@ -42,6 +42,7 @@ Include declarations. */ #include "magick/studio.h" +#include "magick/artifact.h" #include "magick/attribute.h" #include "magick/blob.h" #include "magick/blob-private.h" @@ -9145,6 +9146,9 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info, int i; + int + source; + unsigned int logging; @@ -9294,7 +9298,12 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info, mng_info->ping_exclude_zCCP=MagickFalse; /* hex-encoded iCCP in zTXt */ mng_info->ping_exclude_zTXt=MagickFalse; - value=GetImageOption(image_info,"png:exclude-chunk"); + for (source=0; source<1; source++) + { + if (source==0) + value=GetImageArtifact(image,"png:exclude-chunk"); + else + value=GetImageOption(image_info,"png:exclude-chunk"); if (value != NULL) { @@ -9388,8 +9397,14 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info, } } + } - value=GetImageOption(image_info,"png:include-chunk"); + for (source=0; source<1; source++) + { + if (source==0) + value=GetImageArtifact(image,"png:include-chunk"); + else + value=GetImageOption(image_info,"png:include-chunk"); if (value != NULL) { @@ -9483,6 +9498,7 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info, } } + } if (logging != MagickFalse) { diff --git a/magick/image.c b/magick/image.c index 9aebb1c9e..e1679c4f0 100644 --- a/magick/image.c +++ b/magick/image.c @@ -3817,10 +3817,7 @@ MagickExport MagickBooleanType StripImage(Image *image) (void) DeleteImageProperty(image,"comment"); (void) DeleteImageProperty(image,"date:create"); (void) DeleteImageProperty(image,"date:modify"); -#if 0 /* temporarily removed to wand/mogrify.c, where we have access - to image_info */ (void) SetImageArtifact(image,"png:include-chunk","none,gama"); -#endif return(MagickTrue); } diff --git a/wand/mogrify.c b/wand/mogrify.c index 19f113a80..f6a4e8367 100644 --- a/wand/mogrify.c +++ b/wand/mogrify.c @@ -3161,14 +3161,6 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, Strip image of profiles and comments. */ (void) SyncImageSettings(mogrify_info,*image); - -#if 1 /* This was emporarily moved from image.c, where we don't have access - to image_info - */ - - (void) SetImageProperty(*image,"png:include-chunk","none,gama"); - -#endif (void) StripImage(*image); InheritException(exception,&(*image)->exception); break; -- 2.40.0