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
Avoid overwriting using mogrify
-
- Posts: 3
- Joined: 2013-01-13T13:58:06-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Avoid overwriting using mogrify
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.
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.