Use the image processing library IntegrationImage in Laravel ,. Use the Image processing library IntegrationImage in Laravel. The system requires PHP5.3FileinfoExtensionGDLibrary (2.0) orImagickPHPextension (6.5.7) to install and deploy Integrationima. use the Image processing library Integration/Image in Laravel,
System requirements
- PHP >=5.3
- Fileinfo Extension
- GD Library (> = 2.0 )... Or...
- Imagick PHP extension (> = 6.5.7)
Install and deploy Integration/image
Added in composer. json [require], and then executed composer update
"intervention/image": "2.0.15"
Laravel configuration
After the Integration/image installation and deployment is complete, open the configuration file config/app. php and add code in the corresponding location. then the Image class will be automatically loaded and available. It is powerful enough to handle almost all your image processing needs.
// Service provider 'Intervention \ Image \ imageserviceprovider' // alias configuration 'image' => 'Intervention \ Image \ Facades \ image'
Configuration settings
By default, Integration/Image uses the GD Library extension of PHP. If you want to switch to imagick, you can use php artisan to create a configuration file to add the corresponding configuration.
$ php artisan config:publish intervention/imag
Basic usage
Several basic functions are listed here. For more detailed instructions, see the relevant interface documentation.
1. display an image
Route::get('/', function(){ $img = Image::make('foo.jpg')->resize(300, 200); return $img->response('jpg');});
2. read an image file
$img = Image::make('foo/bar/baz.jpg');
3. draw an image
$img = Image::canvas(800, 600, '#ccc');
4. edit an image
$img = Image::make('foo.jpg')->resize(320, 240)->insert('watermark.png');
Laravel uses the Image processing Library Integration/Image. The system requires PHP = 5.3 Fileinfo Extension GD Library (= 2.0) or Imagick PHP extension (= 6.5.7) to install and deploy Integration/ima...