Repository navigation
Generate webp thumbnails - #6744
Conversation
This adds support for webp thumbnails by explicitly importing the official (but experimental) x/image/webp decoder for webp. Unless the decoder panics (can it?), this is safe. Pocketbase will fall back to reusing the fullsize image if creating a thumbnail fails. Which is already the current behavior for all webp images. Since disintegration/imaging is not aware of webp, webp thumbnails will be generated in png format. This is a caveat but modern web browsers generally don’t rely on file extensions to detect image formats.
|
I'm not really sure. As mentioned in the linked comment, I wanted to avoid the workaround of converting them to jpg/png but since webp thumbs seems to be a common request I guess it could be better than nothing. I'll have to think a little more on it. |
|
In the end it is better than nothing, so let's merge it. If it ended up causing issues we can always revert it. I'll update also the tests to add a mimetype thumb check to ensure that the fallback png is properly generated. |
Does this mean that the thumbnail will be a |

This adds support for webp thumbnails by explicitly importing the
official (but experimental) x/image/webp decoder for webp.
Unless the decoder panics (can it?), this is safe. Pocketbase will fall
back to reusing the fullsize image if creating a thumbnail fails. Which
is already the current behavior for all webp images.
Since disintegration/imaging is not aware of webp, webp thumbnails will
be generated in png format. This is a caveat but modern web browsers
generally don’t rely on file extensions to detect image formats.