imagick批量加水印

平铺convert -size 140x80 xc:none -fill grey  -gravity northwest -draw "text 10,10 'copyright'" -gravity southeast -draw "text 5,15 'copyright'" miff:- | composite -tile - logo.jpg 1.jpg

cat imgwater.sh 

  1 #!/bin/bash

  2 #bash-3.2# convert php.jpg mark.png -gravity southeast -geometry +0+0 -composite dest.jpg

  3 #bash-3.2# convert php.jpg -gravity southeast -fill black -pointsize 16 -draw "text 0,0 'www.phpjx.com'" dest-text.jpg

  4 img_list=`find /var/www/html/uploadfile ! -name "water_*" -name "php*.jpg" -o ! -name "water_*" -name "php*.png"`;

  5 for img in $img_list

  6 do

  7         path=${img%/*}

  8         #echo "path=>"$path

  9         filename=${img##*/}

 10         #echo "filename=>"$filename

 11         fullname=$path/$filename

 12         #echo $fullname

 13         convertfullname=$path/water_$filename

 14         echo $convertfullname

 15         echo "------------------------------------------------------------------------"

 16         if [ -e $convertfullname ]; then

 17                 echo "Picture is already converted small"

 18         else

 19                 echo "File does not exists"

 20                 convert $fullname -gravity southeast -fill red -pointsize 16 -draw "text 0,0 'www.phpjx.com'" $convertfullname

 21         fi

 22 done

 1096  convert -size 750x700 xc:"#ddddff" 2.png
 1097  composite -gravity north 1.png 2.png 11.png
 1098  convert 11.png -gravity southeast -fill black -pointsize 16 -draw "text 0,0 'www.phpjx.com'" 11_.png

    A+
发布日期:2014年04月23日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: