What's Changed
- New image response macro by @olivervogel in #15
The package now includes a Laravel response macro that can be used to elegantly encode image resources and convert it to an HTTP response in a single step.
Example
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Format;
use Intervention\Image\Laravel\Facades\Image;
Route::get('/', function () {
$image = Image::read(Storage::get('example.jpg'))
->scale(height: 300);
return response()->image($image, Format::WEBP, quality: 65);
});
Full Changelog: 1.4.0...1.5.0