Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate webp image in TYPO3 Fluid

I am trying to have TYPO3 10.4.12 generate webp images as described in the example on this page: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Feature-90416-SpecificTargetFileExtensionInImage-relatedViewHelpers.html

{f:uri.image(image:images.0, fileExtension: 'webp')}

I am using GraphicsMagick and with gm version I get

WebP                       yes

and converting a picture to webp manually via command line works.

Also cwebp is installed.

If I try fileExtension: 'png' it generates a png file so the parameter seems to work.

However the image does not get converted, instead the original unprocessed image gets referenced.

like image 624
crsdahl Avatar asked Oct 15 '25 01:10

crsdahl


2 Answers

The main problem seems to have been that I needed to add webp to the [GFX][imagefile_ext] configuration.

Additionally sometimes it only worked after removing all generated images under Remove Temporary Assets in the Maintenance section.

like image 163
crsdahl Avatar answered Oct 18 '25 04:10

crsdahl


Yes that is true, webp must be added to image file list. In addition we faced another problem with webp. If you create an image as jpg with a width and after that the same image as webp also in the same width, only the jpg was generated. That's why we added 1px to the jpg images. Now nearly all picutures are delivered in a modern way on https://www.in2code.de

like image 33
Alex Kellner Avatar answered Oct 18 '25 05:10

Alex Kellner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!