-
-
Save veelenga/dd7b6c3ea9aac339d803ef7c3013d226 to your computer and use it in GitHub Desktop.
ImageMagick Static Binaries with HEIC support for AWS Lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at: | |
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html | |
# | |
# As of Jan 10, 2019, this is: | |
# Amazon Linux AMI 2017.03.1.20170812 x86_64 HVM GP2 (ami-4fffc834) | |
# | |
# 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. | |
# | |
# In a NodeJS runtime, you would add something like the following to the top of | |
# your Lambda function file: | |
# process.env['PATH'] = process.env['LAMBDA_TASK_ROOT'] + '/imagemagick/bin:' + process.env['PATH'] | |
# make/install libde265 | |
git clone https://github.com/strukturag/libde265 && cd libde265 | |
./configure && make && sudo make install | |
# make/install libheif | |
git clone https://github.com/strukturag/libheif && cd libheif | |
./configure && make && sudo make install | |
# make install Image Magick with HEIC support | |
version=7.0.8-23 | |
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel gcc | |
curl -O https://imagemagick.org/download/ImageMagick-$version.tar.gz | |
tar zxvf ImageMagick-$version.tar.gz | |
cd ImageMagick-$version | |
./configure --prefix=/var/task/imagemagick --enable-shared=no --enable-static=yes --with-heic | |
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