A very simple Symfony Bundle that wraps around the Intervention Image ImageManager.
Symfony 3.4
Quoted from Intervention Image:
Intervention Image requires the following components to work correctly.
- PHP >= 5.4
- Fileinfo Extension
And one of the following image libraries.
- GD Library (>=2.0) … or …
- Imagick PHP extension (>=6.5.7)
composer require impulze/intervention-image-bundle
use Impulze\Bundle\InterventionImageBundle\ImageManager;
...
// Get service from container:
$manager = $container->get(ImageManager::class);
...
// Or use symfony dependency injection
public function __construct(ImageManager $manager)
{
$image = $manager->make('public/foo.jpg')->resize(300, 200);
...
}
For all features that come with Intervention Image check their own documentation.
This bundle allows for the following configuration:
# config/packages/impulze_intervention_image.yaml
impulze_intervention_image:
driver: gd # or imagick, defaults to gd