I'm trying to resize a set PNG files from a web source, and am depending on the hashes of the resulting files to be the same if the original file has not changed, while this is the case if I convert to a JPG file, it is not so for PNG files. When I copied the files to a different system for a test, the file creation times were exactly the same, at which point the resulting files were equal. Is there a way to have the convertion not take this creation time in account when writing the resulting PNG file?
The source files:
Code: Select all
db73b11ba8202711748260e06379ee2f source1.png
db73b11ba8202711748260e06379ee2f source2.png
Commands executed:
Code: Select all
convert source1.png -resize 38x38 thumb1.png
convert source1.png -resize 38x38 thumb1-again.png
convert source2.png -resize 38x38 thumb2.png
convert source1.png -resize 38x38 thumb1.jpg
convert source2.png -resize 38x38 thumb2.jpg
The resulting files, JPGs are the same, resize of the same file is the same, resize of a different file with the same contents is different:
Code: Select all
0644cc37e88694af33edcc704590027c thumb1.jpg
0644cc37e88694af33edcc704590027c thumb2.jpg
ad170e808448e244744057a75e360339 thumb1.png
ad170e808448e244744057a75e360339 thumb1-again.png
e7b371313639691532b65e7de744d3f8 thumb2.png
I'm running ImageMagick 6.6.2-6 2011-03-16 Q16 on Ubuntu