EXtcreate-date and EXtmodify-date in PNG-files
Posted: 2009-08-11T23:32:24-07:00
I am using the following Imagemagick script in a batch file to resize large png-images for web upload.
Every now and then the source images are recreated, and the old images are overwritten with new ones with new create and modify dates. The images are overwritten even if they have not changed compared to the old images. After this the above script creates smaller file versions for web upload. The web uploader then uses MD5 binary hashes to check whether the smaller files have changed or not, and uploads the new files, if any.
The problem is that Imagemagick adds EXtcreate-date and EXtmodify-date (creation and modify date of the source file) to the end of the resized png-file, consequently the MD5 hashes of otherwise identical smaller files don't match and the uploader treats all the updated resized files as new files.
Is there a way to avoid this, i.e. to tell Imagemagick not to include information about the source file create and modify date in the resized file?
Code: Select all
FOR %%a in (*.png) DO "C:\Program Files\ImageMagick-6.5.3-Q8\convert.exe" %%a -resize 300x400^ +dither -colors 64 -quality 90 %%~dpna_small.png
The problem is that Imagemagick adds EXtcreate-date and EXtmodify-date (creation and modify date of the source file) to the end of the resized png-file, consequently the MD5 hashes of otherwise identical smaller files don't match and the uploader treats all the updated resized files as new files.
Is there a way to avoid this, i.e. to tell Imagemagick not to include information about the source file create and modify date in the resized file?