Glide Image Manipulation
website·Indexed 37 days ago
http://glide.thephpleague.com/A PHP library for image manipulation that allows for resizing, cropping, and applying effects via a simple API. It supports various image drivers including GD and ImageMagick, integrates with Flysystem for source and cache management, and provides official adapters for frameworks like Laravel, Symfony, Slim, CakePHP, and Zend.
What's inside Glide
- Glide is a framework-agnostic, on-demand image manipulation library for PHP. It provides a straightforward API exposed via HTTP (similar to Imgix or Cloudinary) to adjust, resize, and add effects to images. It leverages Intervention Image for manipulation and Flysystem for file system abstraction. Key features include automatic caching of manipulated images with far-future expires headers, support for multiple image processing drivers (GD, Imagick, and libvips), and the ability to secure image URLs using HTTP signatures.
Overview of Glide image manipulation library
Glide is a PHP library for on-demand image manipulation that exposes a straightforward API via HTTP, similar to services like Imgix and Cloudinary. It is framework-agnostic, Composer-ready, and PSR-2 compliant. It leverages Intervention Image for image handling and Flysystem for file system abstraction.
Key capabilities include:
- Resizing, adjusting, and adding effects to images via HTTP requests.
- Automatic caching of manipulated images with far-future expires headers.
- Support for both GD and Imagick PHP extensions.
- Support for multiple response methods, including PSR-7 and Symfony HttpFoundation.
- URL security via HTTP signatures.
- Compatibility with various file systems through Flysystem.
Overview of Glide image manipulation library
Glide is a PHP library for on-demand image manipulation. It provides a straightforward API exposed via HTTP, allowing developers to adjust, resize, and add effects to images similarly to services like Imgix or Cloudinary. It is framework-agnostic, Composer-ready, and PSR-2 compliant. Glide leverages Intervention Image for image handling and Flysystem for file system abstraction.Migrate Glide to version 4.0.0
Glide 4.0.0 introduces a major migration to Intervention Image v4. Key changes include the normalization of watermark alpha values to a 0-1 range and the introduction of exceptions when an invalid image format is provided.Migrate Glide to version 4.0.0
Glide 4.0.0 introduces a migration to Intervention Image v4. Key changes include a requirement to normalize watermark alpha values to a 0-1 range and the introduction of exceptions when an invalid image format is provided.Generate HTTP responses for images using getImageResponse()
Glide provides thegetImageResponse()method to create HTTP responses for manipulated images. This is the recommended approach overoutputImage()because it allows the application to control the actual output of the image. The specific response object returned depends on the configured response integration (e.g., PSR-7 for Slim or HttpFoundation for Laravel/Symfony).Install Glide framework-specific adapters
Framework-specific adapters for Glide are available to simplify integration. These adapters automatically include the baseleague/glidelibrary, so you do not need to require both.# CakePHP composer require admad/cakephp-glide # Laravel composer require league/glide-laravel # Slim composer require league/glide-slim # Symfony composer require league/glide-symfony # Zend composer require league/glide-zendDownload Glide as a ZIP file
If Composer is not available, Glide can be downloaded manually as a.zipfile from the GitHub releases page by selecting the desired version and clicking the 'Source code (zip)' button.Install the Glide Zend integration package
Install the necessary bridge package via Composer to enable Zend Diactoros support for League Glide.composer require league/glide-zendPHP version requirements for Glide
Glide has evolved its PHP requirements over time:
- Version 1.6.0: Dropped support for PHP 5.x; minimum requirement set to PHP 7.2.
- Version 1.7.0: Added support for PHP 8.
- Version 2.2.3: Verified testsuite on PHP 8.2.
Manage cached images in Glide
Glide provides the ability to delete cached images. By default, cached images are grouped into folders, although this behavior can be disabled in the configuration.PHP version requirements for Glide
Glide has evolved its PHP requirements over time:
- v1.6.0: Dropped support for PHP 5.x; minimum requirement set to PHP 7.2.
- v1.7.0: Added support for PHP 8.
- v2.2.3: Verified testsuite on PHP 8.2.