Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Batch resizing of photos
Date: Sun, 24 Dec 2006 12:07:53
Message-Id: 200612241325.40082.shrdlu@unlimitedmail.org
In Reply to: [gentoo-user] Batch resizing of photos by Mick
1 On Sunday 24 December 2006 12:43, Mick wrote:
2
3 > Hi All,
4 >
5 > I have a load of photos which I would like to resize running some sort
6 > of ImageMagick batch command; e.g.
7 >
8 > convert -resize WxH something.jpeg something_resized.jpeg
9 >
10 > In this case "something" is meant to be the photos in a directory.
11 > How do I do this? (me useless at scripting). :(
12
13 You can use a for loop, with a little trickery to modify the name, eg
14 (untested)
15
16 for i in *.jpeg; do
17 name=${i%.jpeg}
18 convert -resize WxH ${i} ${name}_resized.jpeg
19 done
20
21 if you don't want to keep the original images, then it's simpler:
22
23 for i in *.jpeg; do
24 convert -resize WxH ${i} ${i}.resized
25 mv ${i}.resized ${i} # caution: overwrites original file
26 done
27 --
28 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Batch resizing of photos Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] Batch resizing of photos Neil Bothwick <neil@××××××××××.uk>