public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Batch resizing of photos
@ 2006-12-24 11:43 Mick
  2006-12-24 12:25 ` Etaoin Shrdlu
  2006-12-24 21:05 ` [gentoo-user] " Canek Peláez
  0 siblings, 2 replies; 7+ messages in thread
From: Mick @ 2006-12-24 11:43 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

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).  :(

Merry Christmas to you All and Your dearest and nearest!  :)
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Batch resizing of photos
  2006-12-24 11:43 [gentoo-user] Batch resizing of photos Mick
@ 2006-12-24 12:25 ` Etaoin Shrdlu
  2006-12-24 14:03   ` Mick
  2006-12-25 23:29   ` Neil Bothwick
  2006-12-24 21:05 ` [gentoo-user] " Canek Peláez
  1 sibling, 2 replies; 7+ messages in thread
From: Etaoin Shrdlu @ 2006-12-24 12:25 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Batch resizing of photos
  2006-12-24 12:25 ` Etaoin Shrdlu
@ 2006-12-24 14:03   ` Mick
  2006-12-25 23:29   ` Neil Bothwick
  1 sibling, 0 replies; 7+ messages in thread
From: Mick @ 2006-12-24 14:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

On Sunday 24 December 2006 12:25, Etaoin Shrdlu wrote:
> for i in *.jpeg; do
>   name=${i%.jpeg}
>   convert -resize WxH ${i} ${name}_resized.jpeg
> done

Thank you for a lovely Christmas present!  :)
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Batch resizing of photos
  2006-12-24 11:43 [gentoo-user] Batch resizing of photos Mick
  2006-12-24 12:25 ` Etaoin Shrdlu
@ 2006-12-24 21:05 ` Canek Peláez
  2006-12-25 13:27   ` Mick
  1 sibling, 1 reply; 7+ messages in thread
From: Canek Peláez @ 2006-12-24 21:05 UTC (permalink / raw
  To: gentoo-user

On 12/24/06, Mick <michaelkintzios@gmail.com> wrote:
> Hi All,
>
> I have a load of photos which I would like to resize running some sort of
> ImageMagick batch command; e.g.

If you manage your photos with F-Spot, there is a cool utility to
export your photos to a directory, scaling them in the way if  you
want to. The directory could be any GNOME VFS URI, so it works with
remote directories too. The photos all preserve the EXIF information,
which is very cool.
-- 
Canek Peláez Valdés
Facultad de Ciencias, UNAM

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Batch resizing of photos
  2006-12-24 21:05 ` [gentoo-user] " Canek Peláez
@ 2006-12-25 13:27   ` Mick
  0 siblings, 0 replies; 7+ messages in thread
From: Mick @ 2006-12-25 13:27 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

On Sunday 24 December 2006 21:05, Canek Peláez wrote:
> On 12/24/06, Mick <michaelkintzios@gmail.com> wrote:
> > Hi All,
> >
> > I have a load of photos which I would like to resize running some sort of
> > ImageMagick batch command; e.g.
>
> If you manage your photos with F-Spot, there is a cool utility to
> export your photos to a directory, scaling them in the way if  you
> want to. The directory could be any GNOME VFS URI, so it works with
> remote directories too. The photos all preserve the EXIF information,
> which is very cool.

Thanks.  It looks pretty cool indeed, but I only have a few KDE apps on this 
machine and no Gnome libraries.  The script that ES provided does the job 
nicely.
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Batch resizing of photos
  2006-12-24 12:25 ` Etaoin Shrdlu
  2006-12-24 14:03   ` Mick
@ 2006-12-25 23:29   ` Neil Bothwick
  2006-12-26  3:27     ` [gentoo-user] " Grant Edwards
  1 sibling, 1 reply; 7+ messages in thread
From: Neil Bothwick @ 2006-12-25 23:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

On Sun, 24 Dec 2006 13:25:39 +0100, Etaoin Shrdlu wrote:

> 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

If the convert command fails, the original file will still be overwritten
with a possibly empty output file. A safer option is:

for i in *.jpeg; do
  convert -resize WxH ${i} ${i}.resized && mv ${i}.resized ${i}     # caution: overwrites original file
done


-- 
Neil Bothwick

It is impossible to fully enjoy procrastination
unless one has plenty of work to do.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-user]  Re: Batch resizing of photos
  2006-12-25 23:29   ` Neil Bothwick
@ 2006-12-26  3:27     ` Grant Edwards
  0 siblings, 0 replies; 7+ messages in thread
From: Grant Edwards @ 2006-12-26  3:27 UTC (permalink / raw
  To: gentoo-user

On 2006-12-25, Neil Bothwick <neil@digimed.co.uk> wrote:
> --Sig_QmXi9jAOe7nHzs/ZHwPB5to
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: quoted-printable
>
> On Sun, 24 Dec 2006 13:25:39 +0100, Etaoin Shrdlu wrote:
>
>> if you don't want to keep the original images, then it's simpler:
>>=20
>> for i in *.jpeg; do
>>   convert -resize WxH ${i} ${i}.resized
>>   mv ${i}.resized ${i}     # caution: overwrites original file
>> done
>
> If the convert command fails, the original file will still be overwritten
> with a possibly empty output file. A safer option is:
>
> for i in *.jpeg; do
>   convert -resize WxH ${i} ${i}.resized && mv ${i}.resized ${i}     # cauti=
> on: overwrites original file
> done

You guys are making things too complicated.  As someboyd else
suggested, use mogrify. Or just tell convert to write to the
same filename, and it'll do the right thing:

for i in *.jpeg; do
  convert resize WxH ${i} ${i}
done  

-- 
Grant Edwards                   grante             Yow!  Mr and Mrs PED, can I
                                  at               borrow 26.7% of the RAYON
                               visi.com            TEXTILE production of the
                                                   INDONESIAN archipelago?

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-12-26  3:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-24 11:43 [gentoo-user] Batch resizing of photos Mick
2006-12-24 12:25 ` Etaoin Shrdlu
2006-12-24 14:03   ` Mick
2006-12-25 23:29   ` Neil Bothwick
2006-12-26  3:27     ` [gentoo-user] " Grant Edwards
2006-12-24 21:05 ` [gentoo-user] " Canek Peláez
2006-12-25 13:27   ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox