revoltchat / backend

Monorepo for Revolt backend services.
https://developers.revolt.chat/api/
Other
1.23k stars 140 forks source link

bug: AVIF uploads fail due to decode error #343

Open insertish opened 1 month ago

insertish commented 1 month ago

What happened?

currently AVIF decoding in image-rs is only supported for 8-bit images and when the native dav1d library is a. enabled using the crate feature flag and b. is present on the system when building

need to look into a potential native Rust alternative here or dav1d needs to be added to the build process & instructions need to be updated for developers to install dav1d (annoying)

zombi1944 commented 1 month ago

Using Rust and imagers, you need to make sure that the dav1d library is installed. You can add it by specifying it in Cargo.caml. Or maybe I'm wrong about something.

insertish commented 1 month ago

I'm trying to avoid relying on libraries outside of the Rust ecosystem as they make the project more difficult to build and deploy, ideally we can avoid it entirely but if we can't then:

zombi1944 commented 1 month ago

Hmm, and if you add the dav1d dependency to the Cargo.toml file, then use dav1d = "0.9.1"

gianni-rosato commented 2 weeks ago

Not sure how relevant this is, but rav1d exists, preserving dav1d's assembly opts but replacing the C with Rust. Its performance is pretty similar to dav1d, and it supports the AV1 baseline profile just fine which should allow 10-bit support.