login icons: summary
Gavin A. Bell
gavin at krypton.asd.sgi.com
Fri Oct 12 04:08:38 AEST 1990
I got tired of trying to figure out what arguments to give to izoom to
get the images under 100 x 100 pixels, so I wrote this little shell
script which allows you to specify the size of the new image in
pixels.
--- Save the following stuff in a file called 'zoom',
--- then chmod +x zoom
#!/bin/sh
# Script to take an image and zoom it to a specific size
# Arguments:
# zoom img newimg xsize ysize
if test $# -ne 4 ; then
echo "Usage: " $0 " image new_image xsize ysize"
exit 1
fi
img=$1
imgnew=$2
newx=$3
newy=$4
xsize=`istat $img | grep -v xsize | cut -c1-5`
ysize=`istat $img | grep -v xsize | cut -c7-12`
xscale=`bc -l << EOF
$newx/$xsize
EOF
`
yscale=`bc -l << EOF
$newy/$ysize
EOF
`
echo "Executing command:"
echo "\t" izoom $img $imgnew $xscale $yscale
izoom $img $imgnew $xscale $yscale
echo "Done."
------------END OF LINES TO BE SAVED
--
--gavin (gavin at sgi.com, (415)335-1024)
More information about the Comp.sys.sgi
mailing list