change names using convert on multiple files
Posted: 2007-07-09T23:20:16-07:00
Hi
I'm stuck and new to this so any help is greatly appreciated. I have written a shell script to create a large number of thumbnails (png to gif). This is working but the problem is: file names are changed with the former extension added to the file name, eg. animal.png will become animal.png.gif. How do I remove the .png?
here is the script that I am using:
for img in `ls *.png`
do
convert $img -thumbnail '300x150>' thumbs/$img
done
for img in `ls thumbs/*.png`
do
convert $img -strip $img.gif
done
cheers
I'm stuck and new to this so any help is greatly appreciated. I have written a shell script to create a large number of thumbnails (png to gif). This is working but the problem is: file names are changed with the former extension added to the file name, eg. animal.png will become animal.png.gif. How do I remove the .png?
here is the script that I am using:
for img in `ls *.png`
do
convert $img -thumbnail '300x150>' thumbs/$img
done
for img in `ls thumbs/*.png`
do
convert $img -strip $img.gif
done
cheers