Skip to content

Instantly share code, notes, and snippets.

@yemster
Last active November 3, 2020 19:19
Show Gist options
  • Save yemster/d9bd27bbf130c457b12d9113f8e4deb7 to your computer and use it in GitHub Desktop.
Save yemster/d9bd27bbf130c457b12d9113f8e4deb7 to your computer and use it in GitHub Desktop.
Installing or updating ImageMagick on EC2 Linux AMI
# ******************
# *** FYI :: This turned out to be the missing link in the process *****
# Install the devel packages for png, jpg, tiff. these are dependencies of ImageMagick
# Time taken: ~ 3secs
# ******************
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel
# ******************
# Download and Install Imagemagick
# Time taken: ~ 8mins
# ******************
time mkdir $HOME/sources/imagemagick_build && cd $HOME/sources/imagemagick_build
wget http://www.imagemagick.org/download/ImageMagick-6.9.4-4.tar.bz2 && \
tar xvf ImageMagick-6.9.4-4.tar.bz2 && cd ImageMagick-6.9.4-4 && \
./configure --without-x && \
make && \
sudo make install
# Testing it:
# *****************
$ identify -format '%wx%h' 'https://img0.etsystatic.com/058/0/5345540/il_fullxfull.743396346_reav.jpg'
$ identify -format '%wx%h' 'https://cdn.supadupa.me/shop/36734/images/2309169/mascara_wide.gif'
$ identify -format '%wx%h' 'https://cdn.supadupa.me/shop/36734/assets/30985/J.won_logo-1_large.png'
@diogodias24
Copy link

diogodias24 commented Jun 21, 2019

Hi,

Consider adding -p argument for mkdir (for who don't have the fisrt directory), and change the version, your isn't available anymore:

time mkdir -p $HOME/sources/imagemagick_build && cd $HOME/sources/imagemagick_build
wget http://www.imagemagick.org/download/ImageMagick-7.0.8-49.tar.xz && \
tar xvf ImageMagick-7.0.8-49.tar.xz && cd ImageMagick-7.0.8-49 && \
./configure --without-x && \
make && \
sudo make install

For me, I have to install this too:

sudo yum install php-pecl-imagick.x86_64

Regards

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