sitegeist / sms-responsive-images

This TYPO3 extension provides ViewHelpers and configuration to render valid responsive images based on TYPO3's image cropping tool.
GNU General Public License v2.0
34 stars 18 forks source link

No scaling with empty `crop` (in TYPO3 v11) #92

Closed julianhofmann closed 2 years ago

julianhofmann commented 2 years ago

If there's no cropping configured, null is passed as configuration in $processingInstructions. This way, the image is not scaled at all.

\Sitegeist\ResponsiveImages\Utility\ResponsiveImagesUtility:

        // Generate image
        $processingInstructions = [
            'width' => $candidateWidth,
            'crop' => $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image),
        ];

By unsettling $processingInstructions['crop'] the utility works again.

TYPO3 11.5.3, sms_responsive_images v2.1.1

s2b commented 2 years ago

It seems strange to me that this is a problem with the extension because in the TYPO3 core the same snippet is used: https://github.com/TYPO3/typo3/blob/master/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php#L153

Could you check if you have your problem there as well?

julianhofmann commented 2 years ago

Ok, it is really strange... This behavior, we have only when using the ViewHelper in a certain (custom) extension.

Seems to be caused by the default sizes="(min-width: %1$dpx) %1$dpx, 100vw"... After some time of debugging, I'll "fix" it by setting the needed sizes.