下载
由于Centos系统版本是7.6.1810相关镜像地址停止更新了,所以到vault.centos.org进行下载的,下载版本为:
https://vault.centos.org/7.6.1810/updates/x86_64/Packages/ImageMagick-6.7.8.9-16.el7_6.x86_64.rpm
https://vault.centos.org/7.6.1810/os/x86_64/Packages/libwmf-lite-0.2.8.4-41.el7_1.x86_64.rpm
安装
rpm -Uvh libwmf-lite-0.2.8.4-41.el7_1.x86_64.rpm
安装ImageMagick-6.7.8.9-16.el7_6.x86_64.rpm提示依赖错误。
rpm -Uvh ImageMagick-6.7.8.9-16.el7_6.x86_64.rpm
error: Failed dependencies:
libHalf.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libIex.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libIexMath.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libIlmImf.so.7()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libIlmThread.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libImath.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libSM.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libX11.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libXext.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libXt.so.6()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libcairo.so.2()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libfontconfig.so.1()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libgdk_pixbuf-2.0.so.0()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libgs.so.9()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libjasper.so.1()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libpango-1.0.so.0()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libpangocairo-1.0.so.0()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libpng15.so.15()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
libpng15.so.15(PNG15_0)(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
librsvg-2.so.2()(64bit) is needed by ImageMagick-6.7.8.9-16.el7_6.x86_64
......
如果Linux系统支持yum建议通过yum进行安装通过命令,这样依赖库的版本以及动态库的依赖会自行安装,否则如果手动进行安装十分麻烦。
我整理了相关需要安装的依赖,可能存在遗漏,因为我是一边安装一边整理,相对来说比较乱,但基本上应该都包括在内。
yum install ilmbase
yum install ilmICE
yum install lib64sm6
yum install libXau
yum install libXdmcp
Yum install gcc
Yum install glibc
yum install libglvnd
yum install libpng15
yum install libEGL
yum install libX11
yum install libXext
yum install libXt
yum install libgs
yum install libGL
yum install libGLU
yum install libXft
yum install libthai
yum install pango
对于yum没有的依赖需要自行下载进行安装,根据动态库的名到http://rpmfind.net/去搜索,例如:
然后会查找出对应的动态库需要安装的rpm,可下载进行安装。
但rpm中也有自己的依赖,所以安装起来相对就麻烦,需要把rpm的依赖安装全,才能正常安装,这也是推荐yum安装的原因。
我这里安装的rpm都是通过上面依赖的动态库查找出来的。
rpm –Uvh OpenEXR-libs-1.7.1-8.el7.x86_64.rpm
rpm -Uvh pixman-0.34.0-1.el7.x86_64.rpm
rpm -Uvh cairo-1.15.12-4.el7.x86_64.rpm
rpm -Uvh lib64glut3-3.2.1-2-omv4050.x86_64.rpm
rpm -Uvh jasper-1.900.1-2.el4.rf.x86_64.rpm
rpm -Uvh gdk-pixbuf2-2.36.12-3.el7.x86_64.rpm
rpm -Uvh librsvg2-2.40.20-1.el7.x86_64.rpm
rpm -Uvh ImageMagick-6.7.8.9-16.el7_6.x86_64.rpm
如何你这里安装ImageMagick-6.7.8.9-16.el7_6.x86_64.rpm还是提示缺少依赖可在http://rpmfind.net/查询,通过选择yum和rpm进行安装。
执行
执行命令查看安装结果:
convert -threshold 85% -compress LZW 1.jpg 1.gif