[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shrinking a lot of jpegs?
> > I'm looking for a program that can shrink a large amount of
> > jpeg's by a certain percentage, without manual intervention.
>
> I just did exactly the same thing with "/usr/bin/X11/convert" from
> ImageMagick. Great Tool.
Thanks to everyone that replied.
The "convert" tool from ImageMagick works great!!!
The following script shrinks a list of .jpg's to 18% of original size,
adding an "s" to the new filename. i.e. "pic001.jpg" -> "pic001s.jpg"
#!/bin/sh
for f
do
n=`echo $f | sed -e 's/.jpg/s.jpg/'`
if [ -f "$n" ]; then
echo "overwrite $n? (y/n)"
read ans
[ "$ans" = "y" ] || continue
fi
echo "creating: $n"
convert -geometry 18% "$f" "$n"
done
--------------------------------------------
Bruce Smith bruce@armintl.com
System Administrator / Network Administrator
Armstrong International, Inc.
Three Rivers, Michigan 49093 USA
http://www.armstrong-intl.com/
--------------------------------------------