Hello. I’m using mogrify for the very simple task of “-trim +repage” (which should be an option in Excel VBA’s Chart.Export, but isn’t).
Please, is there a simple means of instructing mogrify not to save the file if there hasn’t been a change. So that if I were to re-“mogrify -trim +repage *.png”, the file modification dates would not change?
Thank you.
mogrify: don’t save if no change
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: mogrify: don’t save if no change
ImageMagick has no feature to my knowledge that knows when there is a no-op and not to process the image. I will defer to the IM developers to correct me, if I am wrong. I think you need to loop over each image and check the trim coordinates using the string format "%@". Then compare the input width to result from that result and then decide to process or not. See http://www.imagemagick.org/script/escape.php