From eecae14bc2d31e9d12472d4c4ec362da1387ba82 Mon Sep 17 00:00:00 2001 From: Stream Date: Mon, 8 Apr 2024 14:24:32 +0800 Subject: [PATCH] feat: implement support for intervention/image v3 in getResize() of ResizeController --- src/Controllers/ResizeController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Controllers/ResizeController.php b/src/Controllers/ResizeController.php index a3233926..e733eaeb 100644 --- a/src/Controllers/ResizeController.php +++ b/src/Controllers/ResizeController.php @@ -19,7 +19,11 @@ public function getResize() $ratio = 1.0; $image = request('img'); - $original_image = Image::make($this->lfm->setName($image)->path('absolute')); + if (class_exists(InterventionImageV2::class)) { + $original_image = InterventionImageV2::make($this->lfm->setName($image)->path('absolute')); + } else { + $original_image = InterventionImageV3::read($this->lfm->setName($image)->path('absolute')); + } $original_width = $original_image->width(); $original_height = $original_image->height();