图片缩放功能开发时,插件安装操作手册,记录以备忘。
插件安装
windows系统
•安装包在共享目录 share常用软件软件专业开发软件Java图片压缩开发
•安装GraphicsMagick-1.3.24-Q16-win64-dll.exe
•webp-imageio-0.4.2windows-x86webp-imageio.dll 文件放到c:windows目录
•检查path变量有无设置:执行gm version 查看支持的图片类型。
linux系统 :
安装依赖包
sudo yum install libtool-ltdl libtool-ltdl-devel
sudo yum -y install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel
sudo install libjpeg-devel libpng-devel libtiff-devel libgif
安装webp格式解析类
cd /usr/local
tar xf libwebp-0.5.1.tar.gz
cd libwebp-0.5.1
./configure
make
sudo make install
sudo cp /usr/local/lib/libwebp.so.6.0.1 /usr/lib64/
sudo ln -s /usr/lib64/libwebp.so.6.0.1 /usr/lib64/libwebp.so.6
sudo ln -s /usr/lib64/libwebp.so.6.0.1 /usr/lib64/libwebp.so
安装GraphicsMagick
sudo tar -xvf GraphicsMagick-1.3.24.tar.gz -C /usr/local/
sudo chown -R deploy:forte GraphicsMagick-1.3.24/
cd /usr/local/GraphicsMagick-1.3.24
./configure ‘–build=i686-redhat-linux-gnu’ ‘–host=i686-redhat-linux-gnu’ ‘–target=i386-redhat-linux-gnu’ ‘–program-prefix=’ ‘–prefix=/usr/local/GraphicsMagick-1.3.24’ ‘–exec-prefix=/usr/local/GraphicsMagick-1.3.24’ ‘–bindir=/usr/local/GraphicsMagick-1.3.24/bin’ ‘–sbindir=/usr/local/GraphicsMagick-1.3.24/sbin’ ‘–sysconfdir=/usr/local/GraphicsMagick-1.3.24/etc’ ‘–datadir=/usr/local/GraphicsMagick-1.3.24/share’ ‘–includedir=/usr/local/GraphicsMagick-1.3.24/include’ ‘–libdir=/usr/local/GraphicsMagick-1.3.24/lib’ ‘–libexecdir=/usr/local/GraphicsMagick-1.3.24/libexec’ ‘–localstatedir=/usr/local/GraphicsMagick-1.3.24/var’ ‘–sharedstatedir=/usr/local/GraphicsMagick-1.3.24/share/com’ ‘–mandir=/usr/local/GraphicsMagick-1.3.24/share/man’ ‘–infodir=/usr/local/GraphicsMagick-1.3.24/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 –with-webp
make
sudo make install
make check
vi /etc/rc.local 添加如下配置:
export GMAGICK_HOME=”/usr/local/GraphicsMagick-1.3.24”
export PATH=”
GMAGICKHOME/bin:
PATH”
LD_LIBRARY_PATH=
GMAGICKHOME/lib:
LD_LIBRARY_PATHexport LD_LIBRARY_PATH # webp格式cp ~/libwebp-imageio.so /usr/local/GraphicsMagick-1.3.24/lib
source /etc/profile
查看支持的图片格式
gm convert -list formatgm version
http://my.oschina.net/u/142836/blog/169382
https://developers.google.com/speed/webp/docs/compiling#unix
相关链接
安装说明:
http://www.graphicsmagick.org/README.html
http://www.imagemagick.org/script/binary-releases.php
webp格式介绍:
https://developers.google.com/speed/webp/docs/api
http://my.oschina.net/u/142836/blog/169382
https://developers.google.com/speed/webp/docs/compiling#unix
webp测评比较:
http://www.uisdc.com/image-format-webp-introduction
使用举例:
http://www.open-open.com/lib/view/open1355754261963.html
http://javantsky.iteye.com/blog/747807
开发手册: