Skip to content
Snippets Groups Projects
Commit c791afec authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[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: default avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent d0a15016
No related merge requests found
Showing
with 370 additions and 402 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment