MyBB Community Forums

Full Version: Support for WEBP images?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I add an attachment type for webp, identify its MIME type as image/webp, it is uploaded as an attachment with a link which can open into a new tab.
The attachment is a type which will not generate a thumbnail, and is not supported as an image in a similar fashion as .png, .jpg, and .gif files.
Searching forum threads for "webp" gives me a short list and incomplete information as to potential solution.
Modern browsers can render the webp format directly.

In this thread, the OP describes a problem as unable to upload the type, and it was apparently fixed with php 7.2 upgrade.
https://community.mybb.com/thread-215871...light=webp
The last post asks the same question as I am, and there were were no further replies then.

In this thread, crazycat shows the image type is hard coded, but there is likely more work to be done.
https://community.mybb.com/thread-228933...light=webp
In inc/functions_image.php, A thumbnail can only be created if imagetype is .gif, .jpg, or .png.
These are using native PHP functions, and there is a native PHP function @createimagefromwebp() although not implemented in MyBB core.

Has anyone added custom code to support webp format in a similar fashion as currently supplied for jpg?
My PR (https://github.com/mybb/mybb/pull/4140) has been rejected, I don't care anymore about webp support for MyBB, I manage it on my way for my own forums.
Thank you for the reference.
I think I'll try core edits on a test platform.
My goal is to treat webp images the same as jpg.

My winter project. Smile
Here's quick fix for 1.8.28-1.8.30 - https://github.com/AlekzNet/MyBB-WEBP-support
Why concentrating on WebP?
It's proprietary, it's patent-encumbered (but royalty-free), it's not yet spread so non-standard, it's made by googol company.
Do not rely on every client is able to display .webp at all.
Better stay safe with file formats that fits accepted standards!

Tomorrow you ask for Apple's HEIF/HEVC format *SCNR

[ETS]
(2022-06-15, 10:05 PM)[ExiTuS] Wrote: [ -> ]Why concentrating on WebP?
It's in general use. If you do not need it - do not use it 😉
(2022-06-15, 10:05 PM)[ExiTuS] Wrote: [ -> ]Tomorrow you ask for Apple's HEIF/HEVC format *SCNR
Rather today...
i want auto webp convert for all the images like avatar signature
webp is good for compressed images, and google tends to like them. so, if you want to save storage space and play nice with the most powerful search engine in the wild wild web, webp may be of interest.