Page 1 of 1

Converting images using imagemagic in DOS

PostPosted: Thu May 06, 2010 7:17 pm
by forhire
Something it easier to do something as a batch. Normally I'd do this kind of stuff in bash... but today I was on a Windows machine so...

First I had a bunch of files with double extensions. Why do it by hand when a one liner will fix it right up:

for %f in (*.jpg.jpg) do ren %f %~nf

Next I re-sized them all using convert with this one liner. The '^>' is an escaped greater than telling convert to only fiddle with the larger images.

for %f in (*.jpg) do convert.exe -resize 400x400^> %f resized/%f