On Sunday 24 December 2006 12:43, Mick wrote:

> Hi All,
>
> I have a load of photos which I would like to resize running some sort
> of ImageMagick batch command; e.g.
>
> convert -resize WxH something.jpeg something_resized.jpeg
>
> In this case "something" is meant to be the photos in a directory. 
> How do I do this? (me useless at scripting).  :(

You can use a for loop, with a little trickery to modify the name, eg 
(untested)

for i in *.jpeg; do
  name=${i%.jpeg}
  convert -resize WxH ${i} ${name}_resized.jpeg
done

if you don't want to keep the original images, then it's simpler:

for i in *.jpeg; do
  convert -resize WxH ${i} ${i}.resized
  mv ${i}.resized ${i}     # caution: overwrites original file
done
-- 
gentoo-user@gentoo.org mailing list

Reply via email to