HEIC Image Support?
-
Any plans for HEIC support? I understand it's not supported by browsers yet but it would be useful to have some way of converting file uploads to jpeg as we're starting to find this an issue with iPhone users.
-
HEIC looks to be a file format (or rather, a container, like mkv, etc.) There's no reason you wouldn't be able to upload
.heif
, etc. files to NodeBB as long as the list of allowed extensions is updated in the ACP backend.Sorry for the delay in responding
-
It works as a file upload but would be nice if it could be converted to a viewable image, especially as a lot of our audience are using newer iphones.
-
https://github.com/lovell/sharp/issues/1105 seems like there is some experimental support but it requires a custom build.
It will require use with a custom, globally-installed libvips that has itself been compiled with support for libheif.
-
Note that HEIF is not a royalty-free codec, but requires one to license HEVC patents from one of the few existing patent pools (it's free for non-commercial use though). So we'll probably have to wait until 2036 (when the patents expire) before it stops being an "experimental" feature in sharp.
The royalty-free web replacement is AVIF - which is AV1 (instead of HEVC) in HEIF container, which is now supported everywhere but Edge (apparently MS is waiting for some licensing details to clear up, but it was added behind a flag recently. Presumably again issues with patents potentially covering the HEIF container too) and of course IE.
It'd be possible to support WebP properly though - it's supported basically everywhere but IE and does offer better compression, but has worse support outside of browsers unfortunately.
Also, probably before HEIF becomes usable for OSS (thanks again, patents!), we'll see a push for JPEG XL - currently Apple and Adobe are definitely on board, and Mozilla is experimenting with support. The only blocker is Chrome, but it seems the competition is forcing them to reconsider their stance. Aside from great compression (at least comparable to AVIF, seems to depend on benchmark which one is better both in speed and size. It does offer by far the best lossless compression too), JXL supports lossless recompression of traditional JPEG images (that is - it doesn't affect their quality even a bit, while decreasing their size by around 20%), and has some additional nice features that AVIF lacks (progressive decoding for one).
AVIF does have better animation support, being based on a video codec and all (though JXL does support animations too, AVIF is just better at compressing them).I'd honestly consider adding WebP support for now - adding it to default allowed extensions, allowed image types and possibly adding an option to convert avatars to WebP (like there currently is for PNG).
Ideally, I think NodeBB should support hosting multiple formats (using
<picture>
where possible to let the browser choose), which would allow for easier transition as we're slowly getting new, better, formats, but that'd require quite a bit more work