一,官方文档地址:
https://imagemagick.org/script/install-source.php
如图:
说明:编译安装前的准备工作,请参见:
https://blog.imgtouch.com/index.php/2023/07/12/imagemagick-bian-yi-an-zhuang-qian-de-zhun-bei-gong-zuo-rocky-linux-9-2/
二,下载并解压缩:
[root@localhost imagemagick]# wget https://imagemagick.org/archive/ImageMagick.tar.gz
[root@localhost imagemagick]# tar -zxvf ImageMagick.tar.gz
三,配置及安装
1,配置
[root@localhost ImageMagick-7.1.1-12]# ./configure --prefix=/usr/local/soft/ImageMagick-7.1.1-12 --disable-shared --without-perl --with-modules --with-png=yes --with-webp=yes --with-jxl=yes --with-heic=yes --with-raw=yes --with-gslib=yes —with-tiff=yes
2,编译
[root@localhost ImageMagick-7.1.1-12]# make
3,安装:
[root@localhost ImageMagick-7.1.1-12]# make install
四,报错信息:
1,报错:
configure: error: no acceptable C compiler found in $PATH
解决:
[root@localhost ImageMagick-7.1.1-12]# yum install gcc
2,报错:
libtool: error: unsupported hardcode properties See the libtool documentation for more information. Fatal configuration error.
make[1]: *** [Makefile:8188:utilities/magick] 错误 1
make[1]: 离开目录“/usr/local/source/imagemagick/ImageMagick-7.1.1-12”
make: *** [Makefile:6236:all] 错误 2
解决:
重新configure并make即可
五,添加到命令的默认路径:
编辑/etc/profile
[root@localhost ImageMagick-7.1.1-12]# vi /etc/profile
添加如下代码:
export MAGICK_HOME=/usr/local/soft/ImageMagick-7.1.1-12
export PATH=$PATH:$MAGICK_HOME/bin
使路径修改生效
[root@localhost ImageMagick-7.1.1-12]# source /etc/profile
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/07/12/imagemagick-bian-yi-fang-shi-an-zhuang-imagemagick7-1-112-rocky-linux-9-2/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
六,查看已安装的版本:
[root@localhost ImageMagick-7.1.1-12]# convert --version
Version: ImageMagick 7.1.1-12 Q16-HDRI x86_64 21239 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in):
Compiler: gcc (11.3)
七,查看ImageMagick支持的格式
安装完成后的magick未必有你想要支持的格式,
用下面的命令进行检查
[root@localhost ImageMagick-7.1.1-12]# identify -list format
Format Mode Description
-------------------------------------------------------------------------------
3FR r-- Hasselblad CFV/H3D39II
3G2 r-- Media Container
3GP r-- Media Container
A* rw+ Raw alpha samples
AAI* rw+ AAI Dune image
AI rw- Adobe Illustrator CS2
APNG rw+ Animated Portable Network Graphics
ART* rw- PFS: 1st Publisher Clip Art
ARW r-- Sony Alpha Raw Image Format
...
八,查看linux的版本:
[root@localhost ImageMagick-7.1.1-12]# cat /etc/redhat-release
Rocky Linux release 9.2 (Blue Onyx)
标签:12,ImageMagick,rocky,--,7.1,root,localhost
From: https://www.cnblogs.com/architectforest/p/17548693.html