[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using convert to batch convert



At 01:30 p.m. 30/07/01 -0700, Aaron Brashears wrote:
I have many, many images that I want to scale down using imagemagick's
convert utility. The convert utility doesn't seem to work correctly
unless you give it an output name per input filename, but the man page
doesn't make it clear how to do this, and I'm stumped as to how to
generate a new name for each input file name.

The command I would expect to work:

convert -sample 50% *

only converts the last file in the directory, and converts it twice
(!) to a filename with '.0' and '.0.0' appended. Any way I can use
convert in some kind of batch mode?

I don't know about convert but if this works
convert -samle 50% original.ext new_file.ext
you can easilyu do that with bash
for i in `ls *`; do convert -sample 50% $i `echo $i |sed -e"s/.*/new_&/"`; done

bash rocks :)



Reply to: