Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sulfo committed Apr 17, 2024
1 parent 1e5296b commit 16e84aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ctessier/nova-advanced-image-field",
"name": "sulfo/nova-advanced-image-field",
"description": "An advanced image field for Nova with cropping and resizing.",
"keywords": [
"laravel",
Expand All @@ -15,8 +15,8 @@
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"intervention/image": "^2.7",
"php": "^8.1",
"intervention/image": "^3.5",
"laravel/nova": "^4.0"
},
"autoload": {
Expand Down
12 changes: 6 additions & 6 deletions src/TransformableImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@

use Illuminate\Http\UploadedFile;
use Intervention\Image\Facades\Image;
use Intervention\Image\ImageManager;

trait TransformableImage
{
/**
* The driver library to use for transforming the image.
*
* This value will override the driver configured for Intervention
* in the `config/image.php` file of the Laravel project.
*
* @var string|null
*/
private $driver = null;
private $driver = \Intervention\Image\Drivers\Gd\Driver::class;

/**
* Indicates if the image is croppable.
Expand Down Expand Up @@ -206,7 +204,9 @@ public function transformImage(UploadedFile $uploadedFile, ?object $cropperData)
return;
}

$this->image = Image::make($uploadedFile->getPathName());
$manager = ImageManager::withDriver($this->driver);

$this->image = $manager->read($uploadedFile->getPathName());

if ($this->autoOrientate) {
$this->orientateImage();
Expand All @@ -225,7 +225,7 @@ public function transformImage(UploadedFile $uploadedFile, ?object $cropperData)
}

$this->image->save($uploadedFile->getPathName(), $this->quality, $this->outputFormat ?? $uploadedFile->getClientOriginalExtension());
$this->image->destroy();
$this->image = null;
}

/**
Expand Down

0 comments on commit 16e84aa

Please sign in to comment.