To install a dependency package:
Yum install libpng libjpeg freetype libpng-devel libjpeg-devel
Download GraphicsMagick Package
Website address: http://www.graphicsmagick.org/
Unzip the build installation:
Tar XF graphicsmagick-1.3.25.tar.gz
./configure--prefix=/usr/local/graphicsmagick-1.3.25--enable-shared--ENABLE-LZW--without-perl--with-modules
Make && make install
Picture Batch processing script:
#!/bin/bashifs= ' echo -en "\n\b" ';echo $IFSfunction genethumb () {for file in ' ls $1 ' doecho $fileimage = "${1}/${file}" thumb= "${1}/thumb_${file}" ext_name=${file##*.} image_basename= ' basename $image ' if [ -d ${ image} ]thengenethumb ${image}elif ( [ ${image_basename:0:5} != "Thumb" ]) && ( [ ! -f ${thumb} ] ) && ( [ $ext _name = ' jpg ' -o $ext _name = ' gif ' -o $ext _name = ' png ' -o $ext _name = ' bmp ' ] ) thenecho $thumb if [ $ext _name = ' PNG ' -o $ext _name = ' bmp '  ]      &Nbsp; then gm convert "$image" - thumbnail 128x128 -colors 256 "$thumb" else gm convert "$image" - thumbnail 128x128 -quality 85 "$thumb" fielseecho "Already exists" fidone}genethumb $1
This article is from the "LINUXGFC" blog, make sure to keep this source http://linuxgfc.blog.51cto.com/6117252/1869215
Linux Image processing Tool GraphicsMagick installation use