Download the PHP package superbig/craft3-imgix without Composer

On this page you can find all versions of the php package superbig/craft3-imgix. 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 craft3-imgix

Imgix plugin for Craft CMS 5.x

Use Imgix with Craft CMS to automatically optimize, resize, and transform your images on-the-fly.

What does this plugin do?

This plugin integrates Imgix's powerful image processing API with Craft CMS, giving you instant access to real-time image transformations. Instead of generating and storing multiple versions of your images on your server, Imgix handles all the heavy lifting in the cloud.

Key features:

Perfect for high-traffic sites that need fast, optimized images without the server overhead.


Table of contents

Understanding Volume Mapping:

The imgixDomains array maps your Craft volume handles to Imgix domains. The plugin looks up the asset's volume handle to determine which Imgix domain to use.

Environment variables

It's recommended to store sensitive values like API keys in environment variables. In your .env file:

  1. Then tell Composer to load the plugin:

  2. In the Control Panel, go to Settings → Plugins and click the “Install” button for Imgix.

Configuration

Quick start

Copy the config.php file from the plugin's src directory into your Craft project's config folder and rename it to imgix.php.

Basic configuration example:

Configuration options

Create a config/imgix.php file with the following options:

Understanding Volume Mapping:

The imgixDomains array maps your Craft volume handles to Imgix domains. The plugin looks up the asset's volume handle to determine which Imgix domain to use.

Advanced Configuration (Array Format)

For more control over each domain, you can use the array format to specify domain-specific settings including secure tokens and path prefixes:

Array format options:

When to use array format:

Note: The imgixSignedToken configuration option is deprecated. Use signingToken within the imgixDomains array format instead. The legacy option is still supported for backward compatibility.

Environment variables

It's recommended to store sensitive values like API keys in environment variables. In your .env file:

Then reference them in config/imgix.php:

Basic Configuration (String Format)

Usage

Basic usage

The plugin provides the craft.imgix.transformImage() method in Twig templates to transform images using imgix.

Simple image transformation:

Multiple transforms (responsive images):

Transform options

Imgix supports a wide range of transformation parameters. Here are the most commonly used:

Size & Cropping:

Image Quality & Format:

Effects & Adjustments:

Default Options:

Apply default options to all transforms:

Focal Points:

The plugin automatically uses Craft's focal point if set on the asset:

Lazy loading

JavaScript-based lazy loading:

Native browser lazy loading:

Custom lazy load prefix:

In your config/imgix.php:

Advanced usage

Using with Element API:

Custom attributes on image tags:

Working with string URLs:

Debugging transforms:

Common use cases

Responsive hero image

Product thumbnail gallery

Blog post featured images

Art direction with different crops

Background image with blur effect

Optimized avatar images

Preventing Upscaling

By default, Imgix will upscale images to match the requested dimensions. For example, if your original image is 800×600 pixels but you request 1920×1080, Imgix will enlarge it. If you want to prevent images from being upscaled beyond their original size, you can enable the preventUpscaling setting in config/imgix.php:

When enabled, this setting automatically applies fit=max to all transformations that don't already have a fit parameter specified. The fit=max mode scales images to fit within the specified dimensions while preventing upscaling beyond the original image size.

If you need to override this behavior for specific transformations, you can explicitly set a different fit parameter:

Troubleshooting

Images not loading

Problem: Images aren't transforming or showing up.

Solutions:

  1. Check that your volume handle matches the key in imgixDomains config
  2. Verify your Imgix domain is correct in the config file
  3. Ensure your Imgix source is properly configured to point to your asset storage
  4. Check that the asset exists and has a valid path

Signed URLs not working

Problem: Getting 403 errors or signature mismatches.

Solutions:

  1. For array format: Verify the signingToken in your volume's array configuration matches the token in your Imgix source settings
  2. For legacy format: Verify your imgixSignedToken matches the token in your Imgix source settings
  3. Make sure URL signing is enabled in your Imgix source
  4. Check for trailing/leading whitespace in your token
  5. Multiple sources: If using multiple Imgix sources, ensure each volume has the correct signingToken specified in the array format (each source has its own token)

Purging not working

Problem: Asset cache isn't being purged when assets are updated.

Solutions:

  1. Verify you have a valid API key with purge permissions
  2. Generate a new API key from https://dashboard.imgix.com/api-keys/new
  3. Ensure the API key has "Purge" permission enabled
  4. Check that you're not using an old API key (< 50 characters) - these are deprecated

Focal point not applied

Problem: Crop isn't respecting Craft's focal point.

Solutions:

  1. Ensure you're using fit: 'crop' in your transform
  2. Verify the focal point is set on the asset in Craft
  3. Check that you're not manually overriding fp-x and fp-y in your transforms

Quality issues

Problem: Images look too compressed or low quality.

Solutions:

  1. Adjust the q parameter (quality): q: 85 for higher quality
  2. Use auto: 'format,compress' to let Imgix optimize automatically
  3. Remove excessive sharpening: sharp: 5-10 is usually sufficient
  4. Ensure source images are high quality

Lazy loading not working

Problem: Lazy loading attributes not appearing.

Solutions:

  1. Verify you're passing lazyLoad: true in the options: {{ image.img({ lazyLoad: true }) }}
  2. Check your lazyLoadPrefix setting in config
  3. Ensure your JavaScript lazy loading library is properly initialized
  4. For native loading, use loading: 'lazy' instead of lazyLoad: true

Different environments

Problem: Images work locally but not in production (or vice versa).

Solutions:

  1. Use environment variables for your Imgix configuration
  2. Ensure .env files are properly configured for each environment
  3. Check that volume handles are consistent across environments
  4. Verify Imgix sources are configured for both development and production URLs

Roadmap


Additional resources


Brought to you by Superbig


All versions of craft3-imgix with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^5.0.0
imgix/imgix-php Version ~3.3.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 superbig/craft3-imgix contains the following files

Loading the files please wait ...