css_styled_content does not respect maxW
css_styled_content in Typo3 CMS 6.0 does not respect the maxW for Content-Type image.
I tried to debug the issue and found out that the Typo-Script directive "imgList.override.field" is responsible.
In File "CssStyledContentController.php" Line 483 does not return the path to the images, instead the UID of the images and the rest of the function fails to locate them and so they are not scaled.
I have attached an Image of the odd rendering.
[BUGFIX] Image CE rendering does not scale images
When rendering images with CssStyledContent while using the features
maxW and equalHeight at the same time, the rendering needs to pre-
calculate the target sizes. Doing this the GifBuilder is used to
determine the width and height of the file while still relying on the
being a locally reachable path. Since the introduction of FAL uids will
be present at that point and therefore this calcuation will fail.
This change extracts the width and height of the image from the
according file object which not only fixes the the mentioned issue but
will be way more performant since the values doe not need to be
derived from the filesystem.
Reviewed-by: Wouter Wolters
Reviewed-by: Frans Saris
Reviewed-by: Thomas Blaß
Tested-by: Thomas Blaß
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack