forhire Site Admin
Joined: 24 Jun 2004 Posts: 338 Location: Morton, Washington
|
Posted: Thu May 06, 2010 6:17 pm Post subject: Converting images using imagemagic in DOS |
|
|
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 |
|