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.

Tokens
26.8K
Snippets
179
Records
241
Agent score
63%

What's inside Glide

  1. Overview of Glide image manipulation library

    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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Generate HTTP responses for images using getImageResponse()

    Glide provides the getImageResponse() method to create HTTP responses for manipulated images. This is the recommended approach over outputImage() 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).
  7. Install Glide framework-specific adapters

    Framework-specific adapters for Glide are available to simplify integration. These adapters automatically include the base league/glide library, 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-zend
  8. Download Glide as a ZIP file

    If Composer is not available, Glide can be downloaded manually as a .zip file from the GitHub releases page by selecting the desired version and clicking the 'Source code (zip)' button.
  9. PHP 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.
  10. 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.
  11. 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.