Page 1 of 1

Avoid overwriting using mogrify

Posted: 2013-01-16T06:47:30-07:00
by gluontronic
Hi there,
I need to improve my script.
I have many tif and jpg files in folders

jpgs are already processed tif ones.

I'm okay with Fred's script : mogrify -path . -format jpg -resize 1500x1000\> *.tif
but if one jpg already exist, it is obviously overwritten.

is there a way to rename the new file or whatever to avoid that ?

many thanks

Re: Avoid overwriting using mogrify

Posted: 2013-01-16T11:53:34-07:00
by fmw42
I use the -path option in mogrify to write all files to a new directory and then if OK remove the old one and rename the new one if needed.

see http://www.imagemagick.org/Usage/basics/#mogrify

In other words cd to the old directory, have a new one ready and put the path to the new one in the -path parameter. That processed the image is the current directory and puts them into the empty new directory.