kwaadpepper / image-resizer
Resize images on the fly and cache them
0.0.10
2022-03-03 11:10 UTC
Requires
- illuminate/support: ~7|~8
- intervention/image: ^2.5
- intervention/imagecache: ^2.5
- laravel/framework: ~7|~8
Requires (Dev)
- orchestra/testbench: ^6.13
- phpunit/phpunit: ~9.0
- squizlabs/php_codesniffer: ^3.5
README
Resizes an image on the fly and returns the new link
Installation
Via Composer
$ composer require kwaadpepper/image-resizer
Usage
1 - Publish config
php artisan vendor:publish --provider="Kwaadpepper\ImageResizer\ImageResizerServiceProvider"
2 - Set a config in templates array (config/image-resizer.php)
'templates' => [
'smallWebp' => [
'height' => 500,
'width' => 250,
'inCanvas' => true,
'format' => 'webp',
'trim' => ['transparent', null, 10]
]
]
3 - in your blade template override an image link
<img src="{{ asset(resize('images/volaillesfr_landing.png', 'smallWebp')) }}" alt="My resized image">
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email github@jeremydev.ovh instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.