How to use ImageMagick in AWS Lambda (ruby 2.7) with WebP support

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • RMagick

    Ruby bindings for ImageMagick

  • require 'rmagick' include Magick module LambdaFunction class Handler def self.process(event:, context:) image_url = event['image_url'] my_image = ImageList.new(image_url) # TODO: Use rmagick to make your image transformations # Docs: https://rmagick.github.io { "success": true } end end end

  • imagemagick-aws-lambda-2

    ImageMagick for AWS Lambda 2 runtimes

  • I wanted to make this guide because while doing all of this process it's been really hard to find information. All the guides I found rely on this layer repository that it's not even updated anymore. I believe having the option to install whatever version of ImageMagick and libraries you want is better. So I hope this helps someone in the future.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • ImageMagick

    🧙‍♂️ ImageMagick 7

  • FROM public.ecr.aws/lambda/ruby:2.7 # OR: FROM amazon/aws-lambda-ruby:2.7 RUN yum groupinstall -y 'Development Tools' RUN yum install -y libmagickwand-devel libtool-ltdl-devel libpng-devel pkgconfig glibc ghostscript ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig RUN curl https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz --output libwebp-1.2.4.tar.gz \ && tar xvzf libwebp-1.2.4.tar.gz\ && cd libwebp-1.2.4 \ && ./configure \ && make \ && make install \ && /sbin/ldconfig /usr/local/lib RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.0 RUN cd ImageMagick-7.1.0\ && ./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \ --prefix=/usr \ --without-perl \ --with-modules \ --without-magick-plus-plus \ --disable-static \ --disable-docs \ --with-png=yes \ --with-webp=yes \ --with-gslib=yes \ && make\ && make install\ && /sbin/ldconfig /usr/local/lib # Copy function code COPY app.rb ${LAMBDA_TASK_ROOT} # Copy dependency management file COPY Gemfile ${LAMBDA_TASK_ROOT} # Install dependencies under LAMBDA_TASK_ROOT ENV GEM_HOME=${LAMBDA_TASK_ROOT} RUN bundle install # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "app.LambdaFunction::Handler.process" ]

  • public-guides

    General repository to upload all the guides

  • Repository: https://github.com/alexmorral/public-guides/blob/main/aws/lambda-imagemagick-docker.md

  • rubygems

    Library packaging and distribution for Ruby.

  • source 'https://rubygems.org' gem 'rmagick'

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • API to create an image (with text/details) and display it

    2 projects | /r/webdev | 26 Jun 2021
  • I fell in love with Ruby but...

    2 projects | /r/ruby | 13 Jan 2023
  • Part 3 — Adding Git, Passenger and Nginx

    4 projects | dev.to | 13 Oct 2022
  • Building a Dot Matrix Animator

    3 projects | dev.to | 10 Nov 2021
  • HEIC support for Active Storage

    3 projects | dev.to | 25 Jun 2021