Skip to content

cbschuld/imagemagick-aws-lambda-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageMagick for AWS Lambda (v7.1.1-21)

Build Layer ZIP

Github Actions based process to compile ImageMagick utilities for AWS Lambda x86_64 instances powered by Amazon Linux 2.x, for the python3.7, python3.8, python3.9, nodejs12.x, nodejs14.x, nodejs16.x and the nodejs18.x lambda runtime.

Description for AWS Serverless Application Repository

Static build of ImageMagick 7.1.1-21 for Amazon Linux (from the AWS SAM team), packaged as a Lambda layer. Bundles ImageMagick including magick, convert, mogrify and identify tools (note: most of the imagemagick tooling is simply symbolic linked back to magick). Supports webp, jpeg, gif, png, tiff and webm formats (all included libraries current as of 2023-05-09).

Library Versions included in the layer

Prerequisites

If you want to build this environment yourself, you will need:

  • Docker
  • Unix Make environment

Bundled libraries

This is not a full-blown ImageMagick setup you can expect on a regular Linux box, it's a slimmed down version to save space that works with the most common formats. You can add more formats by including another library into the build process in Makefile.

These libraries are currently bundled:

Deploying to AWS as a layer

Run the following commands to deploy the Github compiled result as a layer in your AWS account.

wget https://github.com/cbschuld/imagemagick-aws-lambda-layer/releases/download/7.1.1-21/imagemagick-layer.zip
aws lambda publish-layer-version \
    --layer-name imagemagick-v7-1-1_21 \
    --description "ImageMagick v7.1.1-21" \
    --compatible-runtimes nodejs16.x nodejs18.x \
    --compatible-architectures x86_64 \
    --zip-file fileb://imagemagick-layer.zip

Author

Chris Schuld · https://chrisschuld.com/

Thank you to Gojko Adzic for his work on the Makefiles - https://github.com/serverlesspub/imagemagick-aws-lambda-2

Licenses

Contributions ❤️

If a new version of a library appears, please open a PR with the updated version. If you find a bug, please open an issue.