-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avif and webp recognition is bugged #1647
Comments
also even though dav1d works properly, image fails on decoder_to_image() the image is returned as image::color::ColorType::Bgra8 an example file https://github.com/installgentoo/assorted_curiosities/blob/master/trash/test.avif |
specifically fails on this checking Bt601 -> Lrgb and I420 -> Bgra |
Okay i've debugged a bit more, and removing that check at dcv-color-primitives-0.1.16/src/lib.rs:827 makes my avifs load correctly. Could some actual developer help me figure out where the last_src_plane(i suspect?) is set incorrectly? This is something in image crate methinks. |
On top of that dcv issue dav1d 1.0.0 seems to just break avif support. Apparently you have to flush something somewhere now. |
Do you happen to have a reproduction? I suspect we should do a call to |
I'm actively trying to debug. You can grab the test.avif image from my second post and try opening it for yourself. ooops, wrong button |
This is in dav1d. So apparently -11 is EAGAIN |
Alright, first of all - yes, yes it is. -11 is EAGAIN. I just did
in dav1d crate, and that just works. I dunno what's actually supposed to be happening there, whether you have to resend like libheif, or how to define dav1d's EAGAIN properly. Secondly, yes, dcv issue is still there. |
I see that the image size passed to dcv color primitives is 288x285. The height is not a multiple of two, and that case is not supported for the I420 source pixel format.
Thus, it is the root cause generating the If you pass, for example, a 288x284 image, the conversion will succeed. |
we should add an empty line, then?(and remove it from decoded image) |
I opened aws/dcv-color-primitives#65 to track dcv color primitives action items. Assuming your luma plane (y) has original dimensions
For the chroma planes (u, v) [note: their size could be different than luma one!]
Color conversion has to happen passing You will get a |
@fabiosky how do you actually duplicate columns? the file content is magic. btw this also affects webp |
Still occurs with |
It might generally be a good idea to update dAV1d-rs, as the current version used by |
image v0.23.14
Expected
Avif/webp should work
Actual behaviour
Format not recognised on images of odd size
Reproduction steps
Convert image to avif with imagemagick, use libaom backbend for libheif. You get an apparently valid file which begins with 0x00 0x00 0x00 0x1C 0x66 0x74 0x79 0x70 0x61 0x76 0x69 0x66
Magic bytes for avif are (b"\0\0\0 ftypavif", ImageFormat::Avif), and space is 0x20
You can already see the issue. We need another variant of avif with fileseparator in palce of space.
The text was updated successfully, but these errors were encountered: