Skip to content

Commit

Permalink
Include configuration options of Intervention Image 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed May 10, 2024
1 parent c27ff4a commit 08e124b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -22,7 +22,7 @@
"require": {
"php": "^8.1",
"illuminate/support": "^8|^9|^10|^11",
"intervention/image": "^3"
"intervention/image": "^3.7"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
Expand Down
24 changes: 23 additions & 1 deletion config/image.php
Expand Up @@ -16,6 +16,28 @@
|
*/

'driver' => \Intervention\Image\Drivers\Gd\Driver::class
'driver' => \Intervention\Image\Drivers\Gd\Driver::class,

/*
|--------------------------------------------------------------------------
| Configuration Options
|--------------------------------------------------------------------------
|
| These options control the default behavior of Intervention Image.
|
| - `autoOrientation` controls whether an imported image should be
| automatically rotated according to any existing Exif data.
|
| - `decodeAnimation` decideds whether a possibly animated image is
| decoded as such or whether the animation is discarded.
|
| - `blendingColor` Defines the default blending color.
*/

'options' => [
'autoOrientation' => true,
'decodeAnimation' => true,
'blendingColor' => 'ffffff00',
]

];
7 changes: 6 additions & 1 deletion src/ServiceProvider.php
Expand Up @@ -39,7 +39,12 @@ public function register()
);

$this->app->singleton($this::BINDING, function ($app) {
return new ImageManager(config('image.driver'));
return new ImageManager(
config('image.driver'),
autoOrientation: config('image.options.autoOrientation', true),
decodeAnimation: config('image.options.decodeAnimation', true),
blendingColor: config('image.options.blendingColor', 'ffffff00')
);
});
}
}

0 comments on commit 08e124b

Please sign in to comment.