Command or Script to batch convert images in subfolders.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
emen24
Posts: 1
Joined: 2011-11-28T13:17:57-07:00
Authentication code: 8675308

Command or Script to batch convert images in subfolders.

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
Post Reply