Skip to content

Commit

Permalink
initialize invervention imagemanager with gd driver by default
Browse files Browse the repository at this point in the history
  • Loading branch information
reliq committed Jul 7, 2024
1 parent 290afa3 commit 98ee65a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"php": "^8.2",
"illuminate/support": "^11.1",
"intervention/image": "^3.6",
"intervention/image": "^3.7",
"reliqarts/laravel-common": "^8.0",
"ext-json": "*",
"ext-fileinfo": "*",
Expand Down
10 changes: 8 additions & 2 deletions src/Service/ImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

namespace ReliqArts\GuidedImage\Service;

use Intervention\Image\Exceptions\DriverException;
use Intervention\Image\ImageManager as InterventionImageManager;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ImageManagerInterface;
use ReliqArts\GuidedImage\Contract\ImageManager as ImageManagerContract;
use RuntimeException;

final readonly class ImageManager implements ImageManagerContract
final class ImageManager implements ImageManagerContract
{
public function __construct(private InterventionImageManager $manager)
/**
* @throws DriverException
*/
public function __construct(private ?ImageManagerInterface $manager)
{
$this->manager = $manager ?? InterventionImageManager::gd();
}

/**
Expand Down

0 comments on commit 98ee65a

Please sign in to comment.