Download the PHP package ashleydawson/glide-bundle without Composer
On this page you can find all versions of the php package ashleydawson/glide-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ashleydawson/glide-bundle
More information about ashleydawson/glide-bundle
Files in ashleydawson/glide-bundle
Package glide-bundle
Short Description Glide image processing in a Symfony2 project
License MIT
Informations about the package glide-bundle
Glide Bundle
Add Glide HTTP image processing library to Symfony 2 projects.
Introduction
Glide is an image processing/manipulation/cache for images. It's particularly handy for modifying and storing images on Flysystem filesystems. It leverages the Intervention image manager to do the heavy lifting. The image API is exposed via an HTTP interface allowing you to embed images within your application. For example:
For more information and a better explanation, please read the official Glide docs.
This bundle incorporates all aspects of the Glide library within the Symfony 2 service container - adding features and helpers relative to working with the Glide library within Symfony 2 projects.
Installation
You can install the Glide Bundle via Composer. To do that, simply require the package in your composer.json file like so:
Run composer update to install the package. Then you'll need to register the bundle in your app/AppKernel.php
:
Basic Usage
The most simple example is actually using the glide server to process an image within a controller.
The example above will create a glide server using a local filesystem for the source and another for the cache. The action then returns an image response built using the image name (in source filesystem) and request containing the manipulation parameters.
Note: You may want to point the cache filesystem at the Symfony cache, app/cache
.
Custom Manipulators
Manipulators are services that transform an image in some way. There is a library of manipulators that ships with Glide that provide transformations for size, effects, output, etc.
If you'd like to register your own custom manipulator, simply create one and tag it into the manipulator collection within the Symfony 2 service container. Like so:
Then, in the service container, simply tag your new manipulator as being a part of the glide manipulators collection.
In YAML:
Or, in XML:
Ok, now we can use this manipulator on an image:
All versions of glide-bundle with dependencies
symfony/framework-bundle Version ^3.0|^4.0
league/flysystem Version ^1.0
league/glide-symfony Version ^1.0