Page 1 of 1

Command or Script to batch convert images in subfolders.

Posted: 2011-11-28T13:29:08-07:00
by emen24
I have about 3000 sub folders in a directory each containg a single jpg images 200x300. I want to create a new resized image (78x112) in each of those subfolders.

so convert /poster/subfolder1/*.jpg to /poster/subfolder1/thumbnail.jpg
next /poster/subfolder2/*.jpg to /poster/subfolder2/thumbnail.jpg
ect......

I don't want to cd and run simple convert command 3000 times.

Is there a command of script to do this mass change.

Thank you!

Re: Command or Script to batch convert images in subfolders.

Posted: 2011-11-28T13:38:09-07:00
by fmw42
Not that i know about, but I will defer to the IM developers

Mogrify will work on one directory at a time as I understand it. It does not traverse directories.

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

but see the alternate methods that Anthony has identified at http://www.imagemagick.org/Usage/basics/#mogrify_not

Other than that, it is a script loop to cd to the directory, process the image and cd to the next directory, etc