Download the PHP package ace-of-aces/laravel-image-transform-url without Composer

On this page you can find all versions of the php package ace-of-aces/laravel-image-transform-url. 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 laravel-image-transform-url

Laravel Image Transform URL

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Easy, URL-based image transformations inspired by Cloudflare Images.

Features:

Requirements

If you want to use the file caching feature (highly recommended), a configured Storage disk and a Cache driver is required. More info in the Image Caching section.

[!IMPORTANT] It is highly recommended to set a minimum memory limit of 256MB in your php.ini file to avoid memory issues when images are being processed.

Installation

Install the package via composer:

Publish the config file with:

Usage

  1. Configure the package via image-transform-url.php to set your public_path directory, from where you want to transform the images. It is recommended to use a dedicated directory for your images in order to have a separation of concerns.

  2. Test your first image transformation:

Use the following URL format to transform your images:

for example:

Options

[!NOTE] The options are separated by commas and their values are appended with equal signs. The order of options does not matter.

Option Description Type Description / Possible Values
width Set the width of the image. integer Values greater than the original width will be ignored.
height Set the height of the image. integer Values greater than the original height will be ignored.
quality Set the quality of the image. integer 0 to 100
format Set the format of the image. string Supported formats: jpg, jpeg, png, gif, webp.
blur Set the blur level of the image. integer 0 to 100
contrast Set the contrast level of the image. integer -100 to 100
flip Flip the image. string h(horizontal), v(vertical), hv(horizontal and vertical)
version Version number of the image. integer Any positive integer. More info in the Image Caching section.

[!CAUTION] The blur option is a resource-intensive operation and may cause memory issues if the image is too large. It is recommended to use this option with caution, or disable it in the config.

Image Caching

This package comes with the default option to automatically store and serve images statically for the requested options within the caching lifetime.

[!NOTE] Having this feature enabled (default behavior) will help to reduce the load on your server and speed up image delivery.

The processed images are stored in the storage/app/private/_cache/image-transform-url directory by default. You can change the disk configuration in the image-transform-url.php configuration file.

[!CAUTION] When using this option, there is one caveat to be aware of:

Source images are considered to be stale content by their file name and path.

If the content of an original source image changes, but the file name stays the same, the cached images will not be updated automatically until the cache expires. To force a revalidation, you can either:

  1. change the image's file name
  2. move it into another subdirectory, which will change its path
  3. change the version number (integer) in the options (e.g. version=2)
  4. or flush the entire cache of your application using the php artisan cache:clear command.

Rate Limiting

Another feature of this package is the ability to limit the number of transformations that the image transformation route should process per path and IP address within a given time frame.

The rate limit will come into effect for new transformation requests only, and will not affect previously cached images.

By default, rate limiting is disabled for the local and testing app environements to not distract you when developing your app. You can configure the rate limit settings in the image-transform-url.php configuration file.

Usage with CDNs

The package is designed to work seamlessly with CDNs like Cloudflare, BunnyCDN, and others.

The most important configuration is the Cache-Control header, which you can customize to your liking in the image-transform-url.php configuration file.

Error Handling

The route handler of this package is designed to be robust against invalid options, paths and file names, while also not exposing additional information of your applications public directory structure.

This is why the route handler will return a 404 response if:

The only other HTTP error that can be returned is a 429 response, which indicates that the request was rate-limited.

If parts of the given route options are invalid, the route handler will ignore them and only apply the valid options.

Example:

will be processed as:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-image-transform-url with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/contracts Version ^12.0
intervention/image-laravel Version ^1.5
spatie/laravel-package-tools Version ^1.16
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 ace-of-aces/laravel-image-transform-url contains the following files

Loading the files please wait ....