Re: Resizing pictures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Qua 28 Nov 2007, Rick Stevens escreveu:
> 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#

You can do the same in one line using find with mogrify:

find -iname "*.jpg" -exec mogrify -resize 50% {} \;

This will resize all jpg images in the current directory and in the tree 
below it. mogrify is just the same as convert, but it overwrites the 
original file. No need to do that in two steps (convert + mv)

[]'s
Marcelo

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux