Skip to content

Instantly share code, notes, and snippets.

@ARolek
Last active February 10, 2023 00:07
Show Gist options
  • Star 31 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save ARolek/9199329 to your computer and use it in GitHub Desktop.
Save ARolek/9199329 to your computer and use it in GitHub Desktop.
Install ImageMagick from source on Amazon Linux

I needed a newer version of ImageMagick than is available on the yum packages on Amazon Linux. I tried using the remi repo but it failed with dependency errors. Here is what I did to install ImageMagick with support for PNG, JPG, and TIFF.

download the most recent package

wget http://www.imagemagick.org/download/ImageMagick.tar.gz

uncomress the package

tar -vxf ImageMagick.tar.gz

install the devel packages for png, jpg, tiff. these are dependencies of ImageMagick

sudo yum -y install libpng-devel libjpeg-devel libtiff-devel

configure ImageMagick without X11. this is a server without a display (headless) so we don't need X11

cd ImageMagick
./configure --without-x
make && make install

mission complete.

@ARolek
Copy link
Author

ARolek commented Feb 26, 2021

I'm just amazed that this post from 7 years ago is still alive. Thanks for everyone continuing to post updated solutions.

@igal1c0de4n
Copy link

igal1c0de4n commented Mar 1, 2021

Not exactly helping people who insist on ImageMagick, but still may help someone reaching this thread:

I use GraphicsMagick npm pkg with ImageMagick for resizing and converting images in Elastic Beanstalk nodejs.

Locally on macos the code successfully resizes/converts jpg, png, webp formats.

Same code deployed on AWS Elastic Beanstalk: JPEG/PNG formats convert successfully, however WEBP images are identified as PAM images, essentially breaking the ability to resize/convert them.

I consulted AWS support and eventually discovered a work around: dropping GM's ImageMagick mode .subClass({imageMagick: true} and not installing ImageMagick. After that, my nodejs instance worked correctly will the mentioned image formats.

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