]> granicus.if.org Git - imagemagick/commitdiff
Log fact that image->taint is reason for resetting tIME chunk data.
authorglennrp <glennrp@git.imagemagick.org>
Sun, 26 Oct 2014 20:57:13 +0000 (20:57 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Sun, 26 Oct 2014 20:57:13 +0000 (20:57 +0000)
coders/png.c

index 0c93daa9d6cd0b53098e6bffd71b511c0eaff30d..b4130f6d9f3ec1e63033db40cbb76fdd0578452c 100644 (file)
@@ -3103,11 +3103,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
          (void) SetImageProperty(image,"png:PLTE.number_colors",msg,
             exception);
        }
-
+   }
 #if defined(PNG_tIME_SUPPORTED)
-     read_tIME_chunk(image,ping,ping_info,exception);
+   read_tIME_chunk(image,ping,ping_info,exception);
 #endif
-   }
+
 
   /*
     Read image scanlines.
@@ -10690,18 +10690,27 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
       const char
         *timestamp;
 
-      timestamp=GetImageOption(image_info,"png:tIME");
-      if (timestamp != (const char *) NULL)
-        write_tIME_chunk(image,ping,ping_info,timestamp,exception);
-      else
+      if (image->taint == MagickFalse)
         {
-          if (image->taint == MagickFalse)
+          timestamp=GetImageOption(image_info,"png:tIME");
+
+          if (timestamp == (const char *) NULL)
             timestamp=GetImageProperty(image,"png:tIME",exception);
-          write_tIME_chunk(image,ping,ping_info,timestamp,exception);
         }
+
+      else
+        {
+          (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+             "  Reset tIME in tainted image");
+
+          timestamp=GetImageProperty(image,"date:modify",exception);
+        }
+
+      if (timestamp != (const char *) NULL)
+          write_tIME_chunk(image,ping,ping_info,timestamp,exception);
     }
 #endif
-
+  
   if (mng_info->need_blob != MagickFalse)
   {
     if (OpenBlob(image_info,image,WriteBinaryBlobMode,exception) ==