Prepare the installation environment:
Preparation of 1.GCC and other compiling tools:
Yum install-y gcc gcc-c++ make cmake autoconf automake
This generic VPS will have a default installation, check whether the installation can be as follows command:
Rpm-qa|grep GCC
Rpm-qa|grep make
Installation of picture development packages such as 2.libpng and Libjpeg
Yum install-y libpng-devel libjpeg-devel libtiff-devel jasper-devel freetype-devel
In this case, the VPS is usually wooden.
3. Download gm
wget http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.22/GraphicsMagick-1.3.22.tar.gz
4. Unzip the GM
TAR-ZXVF graphicsmagick-1.3.22.tar.gz
5. Compiling and installing GM
CD GraphicsMagick-1.3.22
./configure '--prefix=/usr/local/graphicsmagick-1.3.12 '--exec-prefix=/usr/local/graphicsmagick-1.3.12 '--bindir=/usr/local/graphicsmagick-1.3.12/bin '--sbindir=/usr/local/graphicsmagick-1.3.12/sbin '--sysconfdir =/usr/local/graphicsmagick-1.3.12/etc '--datadir=/usr/local/graphicsmagick-1.3.12/share '--includedir=/usr/ Local/graphicsmagick-1.3.12/include '--libdir=/usr/local/graphicsmagick-1.3.12/lib '--libexecdir=/usr/local/ Graphicsmagick-1.3.12/libexec '--localstatedir=/usr/local/graphicsmagick-1.3.12/var '--sharedstatedir=/usr/ Local/graphicsmagick-1.3.12/share/com '--mandir=/usr/local/graphicsmagick-1.3.12/share/man '--infodir=/usr/ Local/graphicsmagick-1.3.12/share/info '--enable-libtool-verbose '--with-included-ltdl '--enable-shared '-- Disable-static '--with-modules '--with-frozenpaths '--without-perl '--without-magick-plus-plus '-- With-quantum-depth=8 '--enable-symbol-prefix
After executing the above command, there will be an output, you can view the image format supported by GraphicsMagick, the expression of Yes under configured value is supported, PNG, JPEG v1 and zlib must be yes, If no yes will be written according to the premise of the operation, and then repeat the above command, until all support, otherwise it will not work properly
Make && make install
6. Configure Environment variables
Vi/etc/proflie Add the following configuration:
Export Gmagick_home= "/usr/local/graphicsmagick-1.3.21"
Export path= "$GMAGICK _home/bin: $PATH"
Ld_library_path= $GMAGICK _home/lib: $LD _library_path
Export Ld_library_path
Source/etc/profile Effective Configuration environment
7. Use the command to view the image formats supported by GraphicsMagick:
# GM Convert-list formats
If PNG, JPEG, GIF, etc. are displayed in the list, the image conversion is supported
8. Test whether the installation is normal, use the following command:
GM convert-resize 100x80^-gravity center-crop 100x80+0+0 sample.jpg thumb.jpg
Command description: Gravity for central coordinates, selectable values Center, Northwest (top left), Northeast (top right), SouthWest (lower left), southeast (bottom right), from center parameters to both sides, + Specifies the x-axis y-axis offset. Sample.jpg/png for the picture to be cropped and must exist, Thumb.jpg/png is a new picture generated after cropping, you can copy the generated files to the local view, can display normally, it means that all the installation is normal.
Tips
The leader said recently to go online a small project can let me toss with containers, comfortable!!!
Reference:
http://zhenghuali168.iteye.com/blog/1441926
Http://www.cnblogs.com/hjy9420/p/5064908.html
Http://www.jb51.net/LINUXjishu/120332.html
Linux installation GraphicsMagick