Page 1 of 1

convert + resize tif to jpeg for a LOT of folders/subfolders

Posted: 2013-01-14T01:41:12-07:00
by gluontronic
Hi there,
I read this one: viewtopic.php?f=1&t=19198

I have many folders + subfolders.
I want to:
- resize all tiffs that are greater than 1500 for width and/or 1000 for height
- convert all tiffs to jpeg with a specific quality factor

I want to do that in-place (I have backups in case of problem)
I don't want to convert other files in these folders (sometimes I have some png and jpeg)

Do I have to use mogrify ?
I read this http://www.imagemagick.org/Usage/basics/#mogrify_not and I don't really know if I HAVE to use mogrify in my case or not.

Does someone would help me with the ImageMagick/Mogrify parameters part (conditional resize + conversion) ?

ANY leads or help would be very appreciate.

Re: convert + resize tif to jpeg for a LOT of folders/subfol

Posted: 2013-01-14T10:23:22-07:00
by fmw42
mogrify -path path2/folder -format jpg -resize 1500x1000\> *.tif *.tiff

This is for unix. In windows you may have to


mogrify -path path2/folder -format jpg -resize "1500x1000>" *.tif *.tiff

The only other way is to write a script to convert images one-by-one by using a loop over all files in each directory you want.

Re: convert + resize tif to jpeg for a LOT of folders/subfol

Posted: 2013-01-16T06:38:50-07:00
by gluontronic
Hi Fred,
many thanks for your command.
I read about memory problem if we want to do that recursively in MANY folder + subfolders.
any point of view about that ?

is it possible to make a script with a loop to do that? the question is: to let mogrify make the loop or the shell..

Re: convert + resize tif to jpeg for a LOT of folders/subfol

Posted: 2013-01-16T11:51:24-07:00
by fmw42
gluontronic wrote:Hi Fred,
many thanks for your command.
I read about memory problem if we want to do that recursively in MANY folder + subfolders.
any point of view about that ?

is it possible to make a script with a loop to do that? the question is: to let mogrify make the loop or the shell..
You can combine the two. Make a list of all your directories, loop over each one and use mogrify to process all the images in the directory.