#!/bin/sh # # $Id: iAddBorder,v 1.1 2001/11/20 03:11:28 vijoy Exp vijoy $ # # First make it of uniform size (max width of 10") mogrify -geometry 720x720 $1 # Get the original size and border it imgx=`identify $1|cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 1` imgy=`identify $1|cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 2` mogrify -border 8x10 -bordercolor black $1 # Now label-ify label="copyright:vijoy_pandey" labellen=`expr \$label : '.*'` label="copyright vijoy pandey" imgx=`identify $1|cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 1` imgy=`identify $1|cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 2` imgx=`expr $imgx - $labellen \* 6 - 5` imgy=`expr $imgy - 4` if [ $imgx -lt 0 ]; then imgx=0 fi drawopt="text $imgx,$imgy \"$label\"" echo "mogrify -fill white -font x:6x10 -draw '$drawopt' $1" > /tmp/.mogborder chmod +x /tmp/.mogborder echo "Executing.." cat /tmp/.mogborder /tmp/.mogborder rm -rf /tmp/.mogborder