Cykooz / libheif-rs

Safe wrapper to libheif-sys for parsing heif/heic files
MIT License
34 stars 11 forks source link

get_encoder_for_format test fails when building on Fedora #14

Closed kalev closed 1 year ago

kalev commented 1 year ago

When running libheif-rs tests on Fedora, I get:

---- get_encoder_for_format stdout ----
thread 'get_encoder_for_format' panicked at 'assertion failed: `(left == right)`
  left: `"AOMedia Project AV1 Encoder v3.6.1"`,
 right: `"SVT-AV1 encoder v1.4.1"`', tests/heif_struct_test.rs:35:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Any ideas what's going wrong here?

sophie-h commented 1 year ago

I think what might be happening here is that libheif was built with AOM and SVT decoder for av1 enabled, and the tests of libheif-rs are not prepared for this?

So it might be fixed by replacing the loop with an .any() check or something similar.

Cykooz commented 1 year ago

What if I will fix this test in next "major" release of libheif-rs (v0.21)? Is it worth fixing the test in v0.20?

kalev commented 1 year ago

Thanks! Looks like it's indeed the case that libheif is built with both aom and svt enabled: https://src.fedoraproject.org/rpms/libheif/blob/rawhide/f/libheif.spec

For context, I'm interested in libheif-rs because it's a dependency for loupe. Loupe is a new image viewer that @sophie-h is developing and we are planning on shipping in Fedora 39.

This issue here isn't much of a problem for packaging libheif-rs for Fedora; I just noticed it in passing. No need to do a new 0.20 release just for that. There is another issue that I just filed that is a bit of a blocker though: https://github.com/Cykooz/libheif-rs/issues/15

Cykooz commented 1 year ago

I have released v0.21 with fixed get_encoder_for_format test.

kalev commented 1 year ago

Thanks a lot! I can confirm that it now builds fine.