Gentoo Archives: gentoo-user

From: Grant Edwards <grante@××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Batch resizing of photos
Date: Tue, 26 Dec 2006 03:32:01
Message-Id: emq4r5$tsb$1@sea.gmane.org
In Reply to: Re: [gentoo-user] Batch resizing of photos by Neil Bothwick
1 On 2006-12-25, Neil Bothwick <neil@××××××××××.uk> wrote:
2 > --Sig_QmXi9jAOe7nHzs/ZHwPB5to
3 > Content-Type: text/plain; charset=US-ASCII
4 > Content-Transfer-Encoding: quoted-printable
5 >
6 > On Sun, 24 Dec 2006 13:25:39 +0100, Etaoin Shrdlu wrote:
7 >
8 >> if you don't want to keep the original images, then it's simpler:
9 >>=20
10 >> for i in *.jpeg; do
11 >> convert -resize WxH ${i} ${i}.resized
12 >> mv ${i}.resized ${i} # caution: overwrites original file
13 >> done
14 >
15 > If the convert command fails, the original file will still be overwritten
16 > with a possibly empty output file. A safer option is:
17 >
18 > for i in *.jpeg; do
19 > convert -resize WxH ${i} ${i}.resized && mv ${i}.resized ${i} # cauti=
20 > on: overwrites original file
21 > done
22
23 You guys are making things too complicated. As someboyd else
24 suggested, use mogrify. Or just tell convert to write to the
25 same filename, and it'll do the right thing:
26
27 for i in *.jpeg; do
28 convert resize WxH ${i} ${i}
29 done
30
31 --
32 Grant Edwards grante Yow! Mr and Mrs PED, can I
33 at borrow 26.7% of the RAYON
34 visi.com TEXTILE production of the
35 INDONESIAN archipelago?
36
37 --
38 gentoo-user@g.o mailing list