Skip to content

A solution to dynamically handle images on the fly, utilizing Thumbor (thumbor.org)

License

Notifications You must be signed in to change notification settings

phound-inc/serverless-image-handler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIS IS DEAD. THUMBOR WAS KIND OF DUMB(OR).

AWS Serverless Image Handler Lambda wrapper for Thumbor

A solution to dynamically handle images on the fly, utilizing Thumbor (thumbor.org)

Notes from Doug

To build, I got a shell into an ubuntu docker instance, installed the prerequisite libs, then built as outlined below.

The built zip file and CloudFormation templates were uploaded to the thumbnailer-lambda-source-us-west-2 S3 bucket.

The CloudFormation template was run, creating the AWS lambda and AWS API Gateway stuff.

The end result is an HTTP endpoint (currently https://q8udooxx0b.execute-api.us-west-2.amazonaws.com/image/) that acts as a proxy to thumbor, so you can just throw a (signed) thumbor path at the end of that and it should work (e.g., https://q8udooxx0b.execute-api.us-west-2.amazonaws.com/image/Fra_uWcou7dse-P51bf2PrmNQvs=/250x150/smart/upload.wikimedia.org/wikipedia/commons/3/3d/LARGE_elevation.jpg).

OS/Python Environment Setup

sudo yum-config-manager --enable epel
sudo yum update -y
sudo yum install git libpng-devel libcurl-devel gcc python-devel libjpeg-devel -y
sudo pip install --upgrade pip
alias sudo='sudo env PATH=$PATH'
sudo  pip install --upgrade setuptools
sudo pip install --upgrade virtualenv 

Building Lambda Package

cd deployment
./build-s3-dist.sh source-bucket-base-name

source-bucket-base-name should be the base name for the S3 bucket location where the template will source the Lambda code from. The template will append '-[region_name]' to this value. For example: ./build-s3-dist.sh solutions The template will then expect the source code to be located in the solutions-[region_name] bucket

CF template and Lambda function

Located in deployment/dist


Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/asl/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A solution to dynamically handle images on the fly, utilizing Thumbor (thumbor.org)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 80.5%
  • Shell 19.5%