Skip to content

Instantly share code, notes, and snippets.

@moneytoo
Last active June 21, 2022 09:29
Show Gist options
  • Save moneytoo/8c95cc39fd4fd9a18858eb15e379d2f5 to your computer and use it in GitHub Desktop.
Save moneytoo/8c95cc39fd4fd9a18858eb15e379d2f5 to your computer and use it in GitHub Desktop.
ImageMagick 6.7.8 with WebP (libwebp) support on CentOS 7
yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel librsvg2-devel OpenEXR-devel libwebp-devel
rpm -ivh http://vault.centos.org/centos/7/updates/Source/SPackages/ImageMagick-6.7.8.9-15.el7_2.src.rpm
sed -i '/BuildRequires:\tghostscript-devel/a BuildRequires:\tlibwebp-devel' /root/rpmbuild/SPECS/ImageMagick.spec
sed -i '/Requires: pkgconfig/a Requires: libwebp' /root/rpmbuild/SPECS/ImageMagick.spec
rpmbuild -ba /root/rpmbuild/SPECS/ImageMagick.spec
# actual install
rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.7.8.9-15.el7.centos.x86_64.rpm
# if you to disable updates from CentOS repository
yum-config-manager --save --setopt=updates.exclude=ImageMagick*;
# verify WebP support via:
identify -list format
@dauni
Copy link

dauni commented Jan 19, 2021

Didn't work got: this error on the last command:
error: open of /root/rpmbuild/RPMS/x86_64/ImageMagick-6.9.10.68-3.el7.x86_64.rpm failed: No such file or directory
I entered the sed commands and nothing happened. if anything was supposed too?
Please tell me how to remove all
Mitch

You may need to build the RPM first with: rpmbuild -ba /root/rpmbuild/SPECS/ImageMagick.spec

@berkay97
Copy link

This works great with the below tweaks for ImageMagick-6.9.10.68-3 which also required an extra thing not previously listed "lcms2-devel"

yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel librsvg2-devel OpenEXR-devel libwebp-devel lcms2-devel
rpm -ivh http://vault.centos.org/7.8.2003/os/Source/SPackages/ImageMagick-6.9.10.68-3.el7.src.rpm
sed -i '/BuildRequires:\tghostscript-devel/a BuildRequires:\tlibwebp-devel' /root/rpmbuild/SPECS/ImageMagick.spec
sed -i '/Requires: pkgconfig/a Requires: libwebp' /root/rpmbuild/SPECS/ImageMagick.spec
rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.9.10.68-3.el7.x86_64.rpm

Check for it:
identify -list format| grep webp

root@server [/root/]# identify -list format| grep webp
     WEBP* WEBP      rw-   WebP Image Format (libwebp 0.3.0 [0201])
root@server [/root/]#

[root@elegant-fermi x86_64]# rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.9.10.68-3.el7.x86_64.rpm
error: Failed dependencies:
ImageMagick = 6.9.10.68-5.el7_9 is needed by (installed) ImageMagick-devel-6.9.10.68-5.el7_9.x86_64
ImageMagick = 6.9.10.68-5.el7_9 is needed by (installed) ImageMagick-perl-6.9.10.68-5.el7_9.x86_64
[root@elegant-fermi x86_64]#

Cant figure it out. Gives that error.. centos 7 ec2 machine w/plesk

@pitmastervbdev
Copy link

Try:
yum remove ImageMagick

Then
rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.9.10.68-3.el7.x86_64.rpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment