Cykooz / libheif-rs

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

Missing `heif_compression_format_heif_compression_mask` &c when building #23

Closed virtualritz closed 4 months ago

virtualritz commented 4 months ago

The published crate is broken, it seems.

This is presumably because of symbols from libheif-sys that no longer exist in the current version (I'm building against libheif-dev/mantic,now 1.16.2-2ubuntu1 amd64 with use-bindgen).

cargo new heif-test
cd heif-test
cargo add libheif-rs
cargo build
...
Compiling libheif-rs v1.0.1
error[E0425]: cannot find value `heif_compression_format_heif_compression_mask` in crate `lh`
    --> /home/moritz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libheif-rs-1.0.1/src/encoder.rs:40:16
     |
40   |     Mask = lh::heif_compression_format_heif_compression_mask as _,
     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `heif_compression_format_heif_compression_AV1`
     |
    ::: /home/moritz/code/crates/heic-test/target/debug/build/libheif-sys-b99fc4390c36f21a/out/bindings.rs:1536:1
     |
1536 | pub const heif_compression_format_heif_compression_AV1: heif_compression_format = 4;
     | ------------------------------------------------------------------------------- similarly named constant `heif_compression_format_heif_compression_AV1` defined here

error[E0425]: cannot find function `heif_image_handle_get_metadata_item_uri_type` in crate `lh`
    --> /home/moritz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libheif-rs-1.0.1/src/image_handle.rs:225:26
     |
225  |               unsafe { lh::heif_image_handle_get_metadata_item_uri_type(self.inner, metadata_id) };
     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `heif_image_handle_get_metadata_content_type`
     |
    ::: /home/moritz/code/crates/heic-test/target/debug/build/libheif-sys-b99fc4390c36f21a/out/bindings.rs:1014:5
     |
1014 | /     pub fn heif_image_handle_get_metadata_content_type(
1015 | |         handle: *const heif_image_handle,
1016 | |         metadata_id: heif_item_id,
1017 | |     ) -> *const libc::c_char;
     | |____________________________- similarly named function `heif_image_handle_get_metadata_content_type` defined here

error[E0425]: cannot find function `heif_image_handle_get_preferred_decoding_colorspace` in crate `lh`
   --> /home/moritz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libheif-rs-1.0.1/src/image_handle.rs:293:17
    |
293 |             lh::heif_image_handle_get_preferred_decoding_colorspace(
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `lh`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `libheif-rs` (lib) due to 3 previous errors
Cykooz commented 4 months ago

heif_compression_format_heif_compression_mask was added in libheif v1.17. You must use libheif-rs = 0.22.0 if your version of libheif is lower.

virtualritz commented 4 months ago

heif_compression_format_heif_compression_mask was added in libheif v1.17. You must use libheif-rs = 0.22.0 if your version of libheif is lower.

Then there is a bug in the published version of libheif-sys's build.rs? This is referencing v1.16 but should reference v1.17.

Cykooz commented 4 months ago

Oh, you are right. I will fix it.

Cykooz commented 4 months ago

I have released libheif-sys 2.1.1