Skip to content

Instantly share code, notes, and snippets.

@teebu
Forked from bensie/imagemagick.bash
Last active July 11, 2020 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teebu/1d1c7380b1c767ada34c377683c0c943 to your computer and use it in GitHub Desktop.
Save teebu/1d1c7380b1c767ada34c377683c0c943 to your computer and use it in GitHub Desktop.
ImageMagick Static Binaries for AWS Lambda ImageMagick-6.9.10-8 for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime
# As of Nov 23, 2015, this is Amazon Linux AMI 2014.09.2 x86_64 (ami-0c682c64)
#
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH
# with the folder containing these binaries in your Lambda function to ensure
# these newer binaries are used.
#
# imagemagick binary will be in /var/task/imagemagick/bin/convert
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel gcc
wget https://www.imagemagick.org/download/ImageMagick-6.9.10-8.tar.gz
tar zxvf ImageMagick-6.9.10-8.tar.gz
cd ImageMagick
./configure --disable-osx-universal-binary \
--prefix=/var/task/imagemagick \
--disable-silent-rules --enable-shared=no --enable-static=yes --without-modules --disable-openmp \
--with-webp=yes --without-openjp2 \
--with-rsvg --without-x --with-fontconfig=yes --with-freetype=yes --enable-zero-configuration
make
sudo make install
tar zcvf ~/imagemagick.tgz /var/task/imagemagick/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment