PHPackages                             ianreid/aws-image-handler-urls - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. ianreid/aws-image-handler-urls

ActiveCraft-plugin[Image &amp; Media](/categories/media)

ianreid/aws-image-handler-urls
==============================

Create AWS Serverless Image Handler Urls

2.0.0(1mo ago)029MITPHPPHP ^8.2

Since Mar 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ianreidlangevin/craftcms-aws-image-handler)[ Packagist](https://packagist.org/packages/ianreid/aws-image-handler-urls)[ RSS](/packages/ianreid-aws-image-handler-urls/feed)WikiDiscussions v2 Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (7)Used By (0)

[![AWS Image Handler URLs icon](./src/icon.svg)](./src/icon.svg)

AWS Image Handler URLs for Craft CMS
====================================

[](#aws-image-handler-urls-for-craft-cms)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.x | 4.x and first-party [AWS S3 plugin](https://plugins.craftcms.com/aws-s3)

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require ianreid/aws-image-handler-urls -w && php craft plugin/install aws-image-handler-urls

    ```

Setting up AWS Serverless Image Handler
---------------------------------------

[](#setting-up-aws-serverless-image-handler)

Before using this plugin, ensure you have an AWS account and have set up the Serverless Image Handler. This plugin is designed to work with an S3 Filesystem, using the first-party [AWS S3 plugin](https://plugins.craftcms.com/aws-s3).

For instructions on creating a Serverless Image Handler setup on AWS, refer to the official AWS guide: [Serverless Image Handler Implementation Guide](https://aws.amazon.com/solutions/implementations/serverless-image-handler/). The easiest method for most users is to use the provided CloudFormation template.

Overview
--------

[](#overview)

This plugin adds a Twig function to create base64 encoded URL to use with AWS Serverless Image Handler. It also provides a Twig function to easily create SRCSET values based on an array of widths.

**Please, do not open issues for AWS configuration problems.**

Usage in Twig
-------------

[](#usage-in-twig)

Your image must have a valid AWS S3 [Filesystem](https://craftcms.com/docs/4.x/assets.html#filesystems)

### Function imgUrl()

[](#function-imgurl)

Outputs one image URL

ParametersTypeDefaultimageAssetnullwidthInteger960transformsArray\[ \]##### Basic usage to create a encoded URL for a width.

[](#basic-usage-to-create-a-encoded-url-for-a-width)

```

// Query your asset (this is an example)
{% set photo = craft.assets().id(88).one() %}

// This function will generate a 600px width
{{ imgUrl(photo, 600) }}

```

##### Usage with some transforms

[](#usage-with-some-transforms)

```
{% set transforms = {
      flop: true,
      tint: {
         "r" : 0,
         "g" : 0,
         "b" : 255
      }
   }
   %}

{{ imgUrl(photo, 600, transforms) }}

```

##### Usage with inline transforms

[](#usage-with-inline-transforms)

```
{{ imgUrl(photo, 600, { flop : true, grayscale : true }) }}

```

The result HTML will be something like that :

```
https://yourdist.cloudfront.net/eyJidWNrZXQiOiJjp7InIiOjAsImciOjAsImIiOjI1NX19fQ

```

##### Resizing based on height

[](#resizing-based-on-height)

In some Case, it could be helpful to resize an image based on its height, but keeping the original ratio. To achieve that, you can pass the resize transform with height and set the width to 0.

```
{{ imgUrl(photo, 0, { resize: { height:300}} ) }}

```

---

### Function imgSrcset()

[](#function-imgsrcset)

Outputs value for the SRCSET attribute

ParametersTypeDefaultimageAssetnullwidthsArray\[960\]transformsArray\[ \]##### Usage to create srcset values with these widths : 320, 480, 960, 1440, 1920.

[](#usage-to-create-srcset-values-with-these-widths--320-480-960-1440-1920)

```

// Query your asset (this is an example)
{% set photo = craft.assets().id(88).one() %}

// This function will generate a SRCSET string for the provided widths

```

The result HTML for the srcset attribute will be something like that :

```
"https://yourdist.cloudfront.net/eyJidWNrZXInIiOjAsImciOjAsImIiOjI1NX19fQ 320w,
https://yourdist.cloudfront.net/eyJidWNrZXQiOilLCJ0aW50Ijp7InIiOjAsImciOjAsImIiOjI1NX19fQ 480w,
https://yourdist.cloudfront.net/eyJidWNrZXQiOilLCJ0aW50Ijp7InIiOjAsImciOjAsImIiOjI1NX19fQ 960w,
https://yourdist.cloudfront.net/eyJidWNrZXQiOilLCJ0aW50Ijp7InIiOjAsImciOjAsImIiOjI1NX19fQ 1440w,
https://yourdist.cloudfront.net/eyJidWNrZXQiOilLCJ0aW50Ijp7InIiOjAsImciOjAsImIiOjI1NX19fQ 1920w"

```

##### Usage with transforms

[](#usage-with-transforms)

```
{{ imgSrcset(photo, [320, 480, 960], { flop : true, grayscale : true }) }}

```

Sharp JS Transforms
-------------------

[](#sharp-js-transforms)

You can use any Sharp JS Transforms that is supported by AWS Serverless Image Handler.

[View list of transforms](https://sharp.pixelplumbing.com/api-operation).

Note : you have to pass the transforms as TWIG array.

Requesting concurrency limit increase for AWS Image Handler
-----------------------------------------------------------

[](#requesting-concurrency-limit-increase-for-aws-image-handler)

By default, AWS provides a concurrency limit of only 10 simultaneous transforms, which might be insufficient for high-traffic websites or applications. If you encounter issues such as images not displaying, delays in resizing, or general performance bottlenecks, consider requesting a concurrency limit increase.

1. **Assess Your Application's Needs**: Determine the required concurrency level based on your traffic and image processing demands.
2. **Open a New AWS Support Case**: Navigate to the [AWS Support Center](https://aws.amazon.com/support) and click on 'Create case'.
3. **Select 'Service Limit Increase'**: When creating the case, choose 'Service Limit Increase' for the type of request.
4. **Fill in Service Details**: In the 'Case details' section, look for the service related to AWS Image Handler (such as AWS Lambda or API Gateway) from the service name drop-down menu.
5. **Provide Justification**: In your request, specify the desired concurrency limit (e.g., 1000) and provide a clear justification, including usage patterns or metrics that support your request.
6. **Submit Your Case**: Complete the contact information form, review your case details, and submit the request.

The AWS support team will review your request and typically grant a reasonable increase. It's essential to consider the impact on costs associated with higher concurrency limits and to ensure that your architecture is scalable enough to handle the increased processing load.

---

Brought to you by [Ian Reid Langevin](https://www.reidlangevin.com)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~224 days

Recently: every ~266 days

Total

6

Last Release

45d ago

Major Versions

v1.x-dev → 2.0.02026-04-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/13adbf5771a4f5f7033617c9de88ac46a95fb8bc2ebf382fc3f9ac24d7e41545?d=identicon)[ianreidlangevin](/maintainers/ianreidlangevin)

---

Top Contributors

[![ianreidlangevin](https://avatars.githubusercontent.com/u/85630027?v=4)](https://github.com/ianreidlangevin "ianreidlangevin (15 commits)")

---

Tags

awscmsassetsCraftcraftcmscraft-pluginserverlessimage handler

### Embed Badge

![Health badge](/badges/ianreid-aws-image-handler-urls/health.svg)

```
[![Health](https://phpackages.com/badges/ianreid-aws-image-handler-urls/health.svg)](https://phpackages.com/packages/ianreid-aws-image-handler-urls)
```

###  Alternatives

[spacecatninja/imager-x

Ninja powered image transforms.

29390.0k23](/packages/spacecatninja-imager-x)[doublesecretagency/craft-googlemaps

Maps in minutes. Powered by the Google Maps API.

1267.9k](/packages/doublesecretagency-craft-googlemaps)[nystudio107/craft-youtubeliveembed

This plugin allows you to embed a YouTube live stream and/or live chat on your webpage

163.7k](/packages/nystudio107-craft-youtubeliveembed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
