[TASK] Avoid duplicate image crop (crop-crop-scale to crop-scale)
Image cropping has been performed in two steps in case a cropArea (e.g. be the editor) and a crop scale modifier (e.g. "400c" set be the integrator) was combined. These two similar values are now normalized into one cropArea, which simplifies image processing by requiring one crop+scale step instead of one pre-crop plus a second crop-scale step. Note that some tests had to be adapted either because of rounding fixes (we now use round() instead of cast-floor or ceils) and some previous unexpected results (flagged with "why!?") do now produce expected and logical results. (minWidth caused distortion instead of aspect-ratio-preserving scaling) There is one additional behavior adaption: masked sizes (e.g. "400m") no longer upscale images that are smaller. That means masked sizes effectively behaves as `maxWidth` always did. A new testcase is added for this case. Resolves: #103351 Resolves: #91855 Releases: main Change-Id: I0420144879e61072c7c53bc7edbc43541f8f795a Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83299 Tested-by:Oliver Hader <oliver.hader@typo3.org> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php 13 additions, 39 deletionstypo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
- typo3/sysext/core/Classes/Imaging/ImageDimension.php 4 additions, 111 deletionstypo3/sysext/core/Classes/Imaging/ImageDimension.php
- typo3/sysext/core/Classes/Imaging/ImageProcessingInstructions.php 260 additions, 121 deletions...sext/core/Classes/Imaging/ImageProcessingInstructions.php
- typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php 1 addition, 18 deletions.../Classes/Resource/Processing/LocalCropScaleMaskHelper.php
- typo3/sysext/core/Tests/Unit/Imaging/ImageDimensionTest.php 2 additions, 2 deletionstypo3/sysext/core/Tests/Unit/Imaging/ImageDimensionTest.php
- typo3/sysext/core/Tests/Unit/Imaging/ImageProcessingInstructionsTest.php 69 additions, 87 deletions...re/Tests/Unit/Imaging/ImageProcessingInstructionsTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/ImageViewHelperTest.php 10 additions, 12 deletions...luid/Tests/Functional/ViewHelpers/ImageViewHelperTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Uri/ImageViewHelperTest.php 8 additions, 10 deletions.../Tests/Functional/ViewHelpers/Uri/ImageViewHelperTest.php
- typo3/sysext/frontend/Tests/Functional/ContentObject/ContentObjectRendererTest.php 1 addition, 1 deletion...ts/Functional/ContentObject/ContentObjectRendererTest.php
- typo3/sysext/seo/Tests/Functional/MetaTag/MetaTagGeneratorTest.php 2 additions, 1 deletion...ext/seo/Tests/Functional/MetaTag/MetaTagGeneratorTest.php
Please register or sign in to comment