Search code examples
typo3imagemagicktypo3-11.x

Make JPG thumbnails of PDF in TYPO3?


Using the File Links element with thumbnails, PDF files render PNG thumbnails which are quite large in file size.

Is there any way to make TYPO3 render JPG thumbnails instead?

The only setting seems to be [GFX][thumbnails_png] which limits it to either a GIF or PNG.


Solution

  • I assume that you are using FluidStyledContent. The link list has the following template or line (Templates/Uploads.html, line 17):

    <a href="{file.publicUrl}" {f:if(condition:data.target,then: ' target="{data.target}"')}{f:if(condition: file.title, then: ' title="{file.title}"')}>
       <f:media file="{file}" width="150" alt="{file.properties.alternative}" />
    </a>
    

    You can add a fileExtension attribute to the media-ViewHelper. So if you explicitly request "jpg" there, then JPGs should come out.

    This attribute has been introduced in TYPO3 10.3 (Feature #90416)