mael / intervention-image-bundle
Simple intervention/image integration for symfony projects
Installs: 2 975
Dependents: 0
Suggesters: 1
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1
- intervention/image: ^2.5
- symfony/config: ^4.4|^5.0
- symfony/dependency-injection: ^4.4|^5.0
- symfony/http-kernel: ^4.4|^5.0
Suggests
- ext-gd: to use GD library based image processing.
- ext-imagick: to use Imagick based image processing.
This package is auto-updated.
Last update: 2024-11-13 01:20:59 UTC
README
Simple integration for use intervention/image in Symfony project
Requirements
- PHP 7.1
- Symfony >= 4.4
- FileInfo Extension
- GD Library (>= 2.0) or Imagick PHP Extension (>= 6.5.7)
Installation
Run this command in your terminal :
composer require mael/intervention-image-bundle
Answer yes for mael/intervention-image-bundle
Configuration
Register the bundle in your config/bundles.php
Mael\InterventionImageBundle\MaelInterventionImageBundle::class => ['all' => true]
You can chose the driver for image manipulation in config/packages/mael_intervention_image.yaml
mael_intervention_image: driver: gd ## GD or imagick; Default is GD
Usage
use \Mael\InterventionImageBundle\MaelInterventionImageManager; class Foo { public function makeImage(MaelInterventionImageManager $imageManager) { $newImage = $imageManager->make('public/uploads/bar.jpg')->resize(1200, 500); } }
attention, your directory must have permission to write a file
Refer to the intervention/image documentation to know the different options available to manipulate the images.
License
This bundle is under MIT license