PDA

View Full Version : imagemagick resize help


steharg
April 22nd, 2007, 06:55 PM
i am trying to resize a load of images so they are no more than 150x150px

i am currently using

convert -resize 150x150\> *.jpg

but it is renaming all the files to that of the last image then adding a number after each one...
lastfilename.jpg.1
lastfilename.jpg.2
etc

how can i get it to keep its original file name? or even go back over to rename it without the numbers on the end?

kidders
April 23rd, 2007, 10:16 PM
Hi there,

The behaviour you describe is what you would expect, bearing in mind that "*.jpg" would be expanded by Bash into a list of matching filenames, the last of which convert will use as its output file. (See convert's man page.)

You could try using find, or a for loop, so each convert command would only have two filenames in it.