Skip to content

lightaylor/image-optimizer-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image Resizing & Reformatting Lambda Function

The detailed information is available at this link.

Overview

This Lambda function was developed to resize images stored in Amazon S3 to client-specified dimensions and deliver them in a compact, optimized format for efficient viewing.
Since WebP provides a compact image size and efficient performance, it is set as the default output format.

Features

  • 📐 Resize images dynamically to user-requested dimensions
  • 🔄 Convert images to various formats, with WebP as the default
  • ⚡ Optimized for low-latency performance using Lambda@Edge
  • ☁️ Integrated with S3 and CloudFront for seamless delivery and caching

Architecture

  1. Lambda@Edge with CloudFront:
    When CloudFront receives an origin response, it invokes the Lambda function to resize the image and deliver it with caching.

  2. Max Image Dimensions:
    Images are resized to a maximum width or height of 1024px.

  3. Error Handling:
    If an error occurs during processing, the original image is returned.

  4. CloudFront Caching:
    Processed images are cached for 6 months to reduce latency and costs.

  5. Query String Parameters:

    Parameter Description Example
    h Height in pixels h=800
    w Width in pixels w=600
    f File format (extension) f=jpeg
    q Image quality (1–100) q=80

About

Image Resizing & Reformatting Lambda Function

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published