Issue Bug Closed

#83374maxGalleryWidth does not work for PDFs

David Blatter 12/18/17, 14:15 updated 03/23/20, 18:41

Description

When I set tt_content.textmedia.dataProcessing.20.maxGalleryWidth images get scaled down propertly. However the maxGalleryWidth does not have any effect on my PDF (not sure if this is true for all PDFs though). The problem seems to be, that TYPO3 can’t detect the PDFs dimensions and therefore TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor->getCroppedDimensionalProperty($fileObject,‘width’) returns 0.

I was able to fix the issue for me by ignoring the cropped width if it is 0 (see attached file). I’m not sure if this is the way to go but it seems pretty save to me, since a cropped width of zero would always mean that the width was not detected and the maxGalleryWidth would imo be the best fallback value.

The same issue exists in 8.7 and I could fix it with the same patch.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.