Resizing pictures
Rick Stevens
rstevens at internap.com
Wed Nov 28 18:22:59 UTC 2007
On Wed, 2007-11-28 at 09:50 +0000, John Austin wrote:
> On Wed, 2007-11-28 at 10:20 +0900, John Summerfield wrote:
> > Matthieu wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hello,
> > >
> > > I am looking for a software that would allow me to resize
> > > automatically a bunch of JPEG pictues, while letting me choose the
> > > compression rate and keeping the EXIF informations. Waht could provide
> > > that?
> >
> I have a crude script for "some" of this.
>
> As it stands it overwrites the originals !!!
>
> John
>
> naxos bin 816# cat image_reduce_size
> #!/usr/bin/perl -w
> #Reduce size of all *.jpg files in a directory
> #Parameter 50% say
> #cd correct_dir; image_reduce_size 50% *.jpg
> $size = shift @ARGV;
> print $size,"\n";
>
> while(@ARGV){
> $file = shift @ARGV;
> ($bfile = $file) =~ s#.*/##s;
> print $file," ",$bfile,"\n";
> `convert -resize $size $file /tmp/$bfile`;
> `mv -f /tmp/$bfile $file`;
> }
> naxos bin 817#
Of course it overwrites the input files. Your "mv" command is doing
that explicitly.
----------------------------------------------------------------------
- Rick Stevens, Principal Engineer rstevens at internap.com -
- CDN Systems, Internap, Inc. http://www.internap.com -
- -
- "The bogosity meter just pegged." -
----------------------------------------------------------------------
More information about the fedora-list
mailing list