]> Raphaël G. Git Repositories - packbundle/commitdiff
Add formats array and default thumb format
authorRaphaël Gertz <git@rapsys.eu>
Mon, 13 Oct 2025 13:29:36 +0000 (15:29 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 13 Oct 2025 13:29:36 +0000 (15:29 +0200)
DependencyInjection/Configuration.php

index 2f292095b8bbbc76efa7377dcab18eb8e6345e47..be4bb2a45070bf3ab1b5cfa98daa8016824f5fe5 100644 (file)
@@ -110,6 +110,16 @@ class Configuration implements ConfigurationInterface {
                                'lemon' => dirname(__DIR__).'/public/woff2/lemon.woff2',
                                'notoemoji' => dirname(__DIR__).'/public/woff2/notoemoji.woff2'
                        ],
+                       'formats' => [
+                               'ico',
+                               'jpeg',
+                               'jpg',
+                               'png',
+                               'svg',
+                               'tiff',
+                               'webm',
+                               'webp',
+                       ],
                        'map' => [
                                'border' => '#00c3f9',
                                'fill' => '#cff',
@@ -166,6 +176,7 @@ class Configuration implements ConfigurationInterface {
                                'transport' => 'http://a.tile.thunderforest.com/transport/{Z}/{X}/{Y}.png'
                        ],
                        'thumb' => [
+                               'format' => 'jpeg',
                                'height' => 128,
                                'width' => 128
                        ],
@@ -310,6 +321,11 @@ class Configuration implements ConfigurationInterface {
                                                ->defaultValue($defaults['fonts'])
                                                ->scalarPrototype()->end()
                                        ->end()
+                                       ->arrayNode('formats')
+                                               ->treatNullLike([])
+                                               ->defaultValue($defaults['formats'])
+                                               ->scalarPrototype()->end()
+                                       ->end()
                                        ->arrayNode('map')
                                                ->addDefaultsIfNotSet()
                                                ->children()
@@ -371,6 +387,7 @@ class Configuration implements ConfigurationInterface {
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                                        ->scalarNode('height')->cannotBeEmpty()->defaultValue($defaults['thumb']['height'])->end()
+                                                       ->scalarNode('format')->cannotBeEmpty()->defaultValue($defaults['thumb']['format'])->end()
                                                        ->scalarNode('width')->cannotBeEmpty()->defaultValue($defaults['thumb']['width'])->end()
                                                ->end()
                                        ->end()