#!/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/