Skip to content

Commit ff46513

Browse files
authored
Include features of Intervention Image 3.7.0 (#4)
* Update intervention/image base version * Change dependency version for testing * Add support for config options * Update Intervention Image version * Update readme
1 parent 6d893f9 commit ff46513

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,27 @@ return [
3636
## Configuration
3737

3838
By default, the bundle is configured to use the GD library with Intervention
39-
Image. However, the package also offers other drivers. This can be easily
40-
configured by creating a file `config/packages/intervention_image.yaml` and
39+
Image. However, the package also offers other drivers. This and other options of the
40+
library can be easily configured by creating a file `config/packages/intervention_image.yaml` and
4141
setting the driver class as follows.
4242

4343
```yaml
4444
intervention_image:
4545
driver: Intervention\Image\Drivers\Imagick\Driver
46+
options:
47+
autoOrientation: true
48+
decodeAnimation: true
49+
blendingColor: 'ffffff'
4650
```
4751
4852
You can choose between the two supplied drivers `Intervention\Image\Drivers\Gd\Driver` and
4953
`Intervention\Image\Drivers\Imagick\Driver` for example.
5054

55+
You can read more about the different options for
56+
[auto orientation](https://image.intervention.io/v3/modifying/effects#image-orientation-according-to-exif-data),
57+
[decoding animations](https://image.intervention.io/v3/modifying/animations) and
58+
[blending color](https://image.intervention.io/v3/basics/colors#transparency).
59+
5160
## Getting Started
5261

5362
The integration is now complete and it is possible to access the [ImageManager](https://image.intervention.io/v3/basics/instantiation)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"require": {
2424
"php": "^8.1",
25-
"intervention/image": "^3.5",
25+
"intervention/image": "^3.7",
2626
"symfony/framework-bundle": "^6.4|^7"
2727
},
2828
"autoload": {

config/services.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ services:
55
autowire: true
66
arguments:
77
$driver: '%intervention_image.driver%'
8+
$options: '%intervention_image.options%'

src/DependencyInjection/Configuration.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ public function getConfigTreeBuilder(): TreeBuilder
1414
$treeBuilder->getRootNode()
1515
->children()
1616
->scalarNode('driver')
17-
->defaultValue(GdDriver::class)
17+
->defaultValue(GdDriver::class)
18+
->end()
19+
->arrayNode('options')->addDefaultsIfNotSet()
20+
->children()
21+
->booleanNode('autoOrientation')->defaultValue(true)->end()
22+
->booleanNode('decodeAnimation')->defaultValue(true)->end()
23+
->scalarNode('blendingColor')->defaultValue('ffffff')->end()
24+
->end()
1825
->end()
1926
->end();
2027

src/DependencyInjection/InterventionImageExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ public function load(array $configs, ContainerBuilder $container): void
1919
$configuration = new Configuration();
2020
$config = $this->processConfiguration($configuration, $configs);
2121
$container->setParameter('intervention_image.driver', $config['driver']);
22+
$container->setParameter('intervention_image.options', $config['options']);
2223
}
2324
}

0 commit comments

Comments
 (0)