libvips/tools/shrink_width.in
John Cupitt e0d4ed89ff reorganise tools/ dir
The subdir in tools are no lonmger necessary. Also, remove ther old bin
links feature, not very useful anymore.
2011-04-06 12:06:32 +01:00

19 lines
360 B
Bash

#!/bin/sh
# shrink to a target width
# default prefix
VIPSHOME=${VIPSHOME-@prefix@}
name=$0
bname=`basename $0`
if [ $# != 3 ]; then
echo "${bname}: usage: $bname <in> <out> <target width>"
exit 1
fi
inwidth=`$VIPSHOME/bin/vips im_header_int Xsize $1`
factor=`(echo scale=10; echo $inwidth / $3) | bc`
$VIPSHOME/bin/vips im_shrink $1 $2 $factor $factor