diff --git a/typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php b/typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php index aa1edccb96a56869ca4b10adf5985e4ff6fc33d8..d46d41741a40aa19c7141ffcddaa29fa2c5d6b53 100644 --- a/typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php +++ b/typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php @@ -49,7 +49,7 @@ class FormEngineUtility 'select' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'treeConfig'], 'group' => ['size', 'autoSizeMax', 'max_size', 'maxitems', 'minitems', 'readOnly'], 'inline' => ['appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label', 'readOnly'], - 'imageManipulation' => ['ratios'] + 'imageManipulation' => ['ratios', 'cropVariants'] ]; /** diff --git a/typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php b/typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php index 0c1a632905f0a98aa27a2373cf54dd61481785d7..7b96db8fa97a7a53e7ea842a1509cfea755f8182 100644 --- a/typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php +++ b/typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php @@ -62,10 +62,10 @@ class Area { try { return new self( - $config['x'], - $config['y'], - $config['width'], - $config['height'] + (float)$config['x'], + (float)$config['y'], + (float)$config['width'], + (float)$config['height'] ); } catch (\Throwable $throwable) { throw new InvalidConfigurationException(sprintf('Invalid type for area property given: %s', $throwable->getMessage()), 1485279226, $throwable); diff --git a/typo3/sysext/core/Classes/Imaging/ImageManipulation/Ratio.php b/typo3/sysext/core/Classes/Imaging/ImageManipulation/Ratio.php index d13b41b8eaf8bad5ef1b734c97321516afd02f17..d8301cd5d229a743978567e9e48c7851b6a58e49 100644 --- a/typo3/sysext/core/Classes/Imaging/ImageManipulation/Ratio.php +++ b/typo3/sysext/core/Classes/Imaging/ImageManipulation/Ratio.php @@ -58,7 +58,7 @@ class Ratio $areas[] = new self( $id, $ratioConfig['title'], - $ratioConfig['value'] + (float)$ratioConfig['value'] ); } } catch (\Throwable $throwable) { diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-79812-AllowOverridingCropVariantsForImageManipulation.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-79812-AllowOverridingCropVariantsForImageManipulation.rst new file mode 100644 index 0000000000000000000000000000000000000000..f04679ee57034cde5182d4ddc648c9154dd5079b --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-79812-AllowOverridingCropVariantsForImageManipulation.rst @@ -0,0 +1,48 @@ +.. include:: ../../Includes.txt + +====================================================================== +Feature: #79812 - Allow overriding cropVariants for Image Manipulation +====================================================================== + +See :issue:`79812` + +Description +=========== + +With the introduction of :issue:`75880` you now can define multiple cropVariants in TCA. With this feature it is now possible to change or override these cropVariants via TSconfig. + +Setting a FormEngine option through :ts:`TCEFORM.sys_file_reference.crop.config.cropVariants.*` does now work. + + +.. code-block:: typoscript + + TCEFORM.sys_file_reference.crop.config.cropVariants { + default { + title = Default desktop + selectedRatio = NaN + allowedAspectRatios { + NaN { + title = free + value = 0.0 + } + } + } + specialMobile { + title = Our special mobile variant + selectedRatio = NaN + allowedAspectRatios { + 4:3 { + title = ratio 4/3 + value = 1.3333333 + } + } + } + } + + +Impact +====== + +It is not possible to change or override cropVariants via Page and User TSconfig. + +.. index:: Backend, FAL, TSConfig \ No newline at end of file