batch conversion from cmd line
Discussion
I want to use ImageMagick for batch file conversion; PNG format pictures to JPG.
On a single image,
bodo@bulldog:~> convert picture.png picture.jpg
works very well.
Now, when I type
bodo@bulldog:~> convert *.png <what goes here?>.jpg
"$" and "%f" don't work. Does anyone know how to do it without a shellscript?
On a single image,
bodo@bulldog:~> convert picture.png picture.jpg
works very well.
Now, when I type
bodo@bulldog:~> convert *.png <what goes here?>.jpg
"$" and "%f" don't work. Does anyone know how to do it without a shellscript?
Highly Overpaid Coder said:
#!/bin/sh
for a in `ls *.png`
do
nf=`convert $a ${a%.png}.jpg`
done;
Stick that in a bodo.sh
chmod bodo.sh +x
then just execute it in the dir with the .png files in, it will read them in and pass the relevant details to convert (assuming its pathed! if not edit the script for full convert path)
its very basic, with NO error checking.. so use at own risk blah blah.
Worked when I tested this end tho.
Enjoy.

JamieBeeston said:Cheers, Jamie! Works very well
Highly Overpaid Coder said:
#!/bin/sh
for a in `ls *.png`
do
nf=`convert $a ${a%.png}.jpg`
done;
Stick that in a bodo.sh
chmod bodo.sh +x
then just execute it in the dir with the .png files in, it will read them in and pass the relevant details to convert (assuming its pathed! if not edit the script for full convert path)
its very basic, with NO error checking.. so use at own risk blah blah.
Worked when I tested this end tho.
Enjoy.
I owe you a pint

Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



