[NTLUG:Discuss] shrink images globally
Steve Baker
sjbaker1 at airmail.net
Fri Dec 3 20:36:24 CST 2004
Terry Henderson wrote:
> I sometimes find the need to resize a whole directory of images to a
> certain size and would like to learn some efficient way to do it
> globally. I use gimp, but it's several mouse clicks and you manually
> enter pixel sizes each time for each image and if there are 20 or 30
> images, well, you can imagine, it's time consuming.
You need something that'll take arguments on the command line - try
Image Magick....oh - right - you already found that.
Then you can do a 'find' for all files with the right extension:
find . -name \*.jpg -exec myscript {} \;
...then in 'myscript' write something like;
convert -size 640x480 $1 tempfile.jpg
mv tempfile.jpg $1
...a combinations of 'find' and a script will solve almost any problem
that involves processing a bunch of files.
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net> WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net http://tuxaqfh.sf.net
http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----
More information about the Discuss
mailing list