#!/bin/sh
# vim: set sw=4 ts=4 et:
# wirtten by katja socher <katja@linuxfocus.org>
# and guido socher <guido@linuxfocus.org>
#
#
ver="0.1"
help()
{
 cat <<HELP
imgsrcline -- generate a <img src=... width= height=> line
for a number of images
USAGE: imgsrcline [-h] image1 image2 ...
OPTIONS: -h this help
EXAMPLE: imgsrcline test.gif
This program uses the identify utility from ImageMagick
version $ver
HELP
 exit 0
}
error()
{
 echo "1ドル"
 exit "2ドル"
}
while [ -n "1ドル" ]; do
case 1ドル in
 -h) help;shift 1;;
 --) break;;
 -*) echo "error: no such option 1ドル. -h for help";exit 1;;
 *) break;;
esac
done
if [ -z "1ドル" ];then
 error "No image specified, -h for help" 1
fi
# process each image
for imgfile in $* ;do
 if [ ! -r "$imgfile" ]; then
 echo "ERROR: can not read $imgfile\n"
 else
 geometry=`identify $imgfile | awk '{print 2ドル}'`
 # geometry can be 563x144+0+0 or 75x98
 # get rid of the +0+0
 width=`echo $geometry | sed 's/[^0-9]/ /g' | awk '{print 1ドル}'`
 height=`echo $geometry | sed 's/[^0-9]/ /g' | awk '{print 2ドル}'`
 echo "<img src=\"$imgfile\" width=\"$width\" height=\"$height\" alt=\"[]\">"
 fi
done

AltStyle によって変換されたページ (->オリジナル) /