Skip to content

Commit

Permalink
feat: implement support for intervention/image v3 in getResize() of R…
Browse files Browse the repository at this point in the history
…esizeController
  • Loading branch information
streamtw committed Apr 8, 2024
1 parent 70aba67 commit eecae14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Controllers/ResizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit eecae14

Please sign in to comment.