nlfiedler / magick-rust

Rust bindings for ImageMagick
https://crates.io/crates/magick_rust
Apache License 2.0
259 stars 68 forks source link

Fails to build with ImageMagick 7.1.1.17 #108

Closed vpzomtrrfrt closed 1 year ago

vpzomtrrfrt commented 1 year ago

Works fine in 7.1.1.15, but compiling with 7.1.1.17 fails with this error:

error[E0425]: cannot find value `QuantumRange` in module `bindings`
   --> src/wand/magick.rs:341:22
    |
341 |         Ok(bindings::QuantumRange)
    |                      ^^^^^^^^^^^^ not found in `bindings`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `magick_rust` (lib) due to previous error

Looks like #40, but in this case both versions were compiled with hdri enabled

nlfiedler commented 1 year ago

Super, and it's happening on macOS as well, so I can't blame it on Windows or an obscure Linux distro. I will have to dig into what has changed in MagickWand and see if there is an appropriate work-around.

nlfiedler commented 1 year ago

The only impact the disable-hdri feature has is causing magick-rust to compute the equivalent value for QuantumRange, so I'm going to make that feature a default and call this fixed. From what I can tell, the QuantumRange constant is always defined or the MagickWand would fail to build. This seems like a bug in rust-bindgen again, but why it suddenly happens with a slightly different version of MagickWand, I don't know. There are 260+ commits in MagickWand since the 7.1.1.15 version, so narrowing this down is not worth the trouble given how little this matters to magick-rust.

nlfiedler commented 1 year ago

Fixed in commit 8a9536d83a9a524c4274c487bba0a424d6f256e0