Download the PHP package ianreid/aws-image-handler-urls without Composer

On this page you can find all versions of the php package ianreid/aws-image-handler-urls. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aws-image-handler-urls

AWS Image Handler URLs for Craft CMS

Requirements

This plugin requires Craft CMS 3.x | 4.x and first-party AWS S3 plugin

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

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.

For instructions on creating a Serverless Image Handler setup on AWS, refer to the official AWS guide: Serverless Image Handler Implementation Guide. The easiest method for most users is to use the provided CloudFormation template.

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

Your image must have a valid AWS S3 Filesystem

Function imgUrl()

Outputs one image URL

Parameters Type Default
image Asset null
width Integer 960
transforms Array [ ]
Basic usage to create a encoded URL for a width.
Usage with some transforms
Usage with inline transforms

The result HTML will be something like that :

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.


Function imgSrcset()

Outputs value for the SRCSET attribute

Parameters Type Default
image Asset null
widths Array [960]
transforms Array [ ]
Usage to create srcset values with these widths : 320, 480, 960, 1440, 1920.

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

Usage with transforms

Sharp JS Transforms

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

View list of transforms.

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

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 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


All versions of aws-image-handler-urls with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0|^4.0
craftcms/aws-s3 Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ianreid/aws-image-handler-urls contains the following files

Loading the files please wait ....