Bug #83374
closedmaxGalleryWidth does not work for PDFs
0%
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.
Files
Updated by Sybille Peters over 6 years ago
Thank you for your report.
Even though it has been some time, would you consider checking if your patch idea is still up to date and upload it to our Gerrit review server?
Someone could do this for you, but I am thinking you might like the opportunity to contribute to TYPO3 yourself.
You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack
Also, if your issue is no longer reproducable, please let us know in the slack channel, so that this issue can be closed.
Thank you in advance!
Sybille
Updated by Stephan grass about 6 years ago
Hi,
maxGalleryWidth does not work for PDFs also in TYPO3 8.7.16
I try to set the maxGalleryWidth dependent on the frame_class:
tt_content.textmedia.dataProcessing.20.maxGalleryWidth.cObject = CASE
tt_content.textmedia.dataProcessing.20.maxGalleryWidth.cObject {
key.field = frame_class
custom-150 = TEXT
custom-150.value = 100
...
}
The fix by David Blatter will work for me.
Updated by Susanne Moog over 4 years ago
- Related to Bug #88047: GalleryProcessor PDF dimensions added
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
This has been fixed with https://review.typo3.org/c/Packages/TYPO3.CMS/+/60357