hyperbacked icon indicating copy to clipboard operation
hyperbacked copied to clipboard

Perhaps two different versions of crate `image` are being used?

Open teodargent opened this issue 2 years ago • 8 comments

Hi, total noob here! I'm getting this error while compiling. Can anyone help?

error[E0308]: mismatched types
  --> src/qrcode.rs:31:39
   |
31 |           let barcodes = decoder.decode(&image::DynamicImage::ImageRgb8(
   |  ________________________________------_^
   | |                                |
   | |                                arguments to this method are incorrect
32 | |             ImageBuffer::from_raw(frame_img.width(), frame_img.height(), raw_img.to_owned())
33 | |                 .expect("Freshly exported image must be valid"),
34 | |         ));
   | |_________^ expected `image::dynimage::DynamicImage`, found `DynamicImage`
   |
   = note: `DynamicImage` and `image::dynimage::DynamicImage` have similar names, but are actually distinct types
note: `DynamicImage` is defined in crate `image`
  --> /Users/teo/.cargo/registry/src/github.com-1ecc6299db9ec823/image-0.23.14/./src/dynimage.rs:43:1
   |
43 | pub enum DynamicImage {
   | ^^^^^^^^^^^^^^^^^^^^^
note: `image::dynimage::DynamicImage` is defined in crate `image`
  --> /Users/teo/.cargo/registry/src/github.com-1ecc6299db9ec823/image-0.24.6/./src/dynimage.rs:57:1
   |
57 | pub enum DynamicImage {
   | ^^^^^^^^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `image` are being used?
note: method defined here
  --> /Users/teo/.cargo/registry/src/github.com-1ecc6299db9ec823/bardecoder-0.4.1/src/decoder.rs:26:12
   |
26 |     pub fn decode(&self, source: &IMG) -> Vec<Result<RESULT, Error>> {
   |            ^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hyperbacked` due to previous error

teodargent avatar Apr 25 '23 22:04 teodargent

An update on this. I was able to compile and run this using bardecoder = "=0.4.0" instead of bardecoder = "0.4" in the Cargo.toml file as someone on reddit suggested, more info here.

However, the Restore Backup feature does not work for me. I get this error in the terminal:

Running `target/debug/hyperbacked`
Failed to scan code!

I tried on Windows and got the same error. Although I don't have a webcam on Windows so I used Droidcam in order to use my smartphone as one. Not sure if that's compatible with Hyperbacked.

teodargent avatar May 09 '23 17:05 teodargent

It looks like the issue is with nokhwa. Check the link in the comment above. @Twometer

teodargent avatar May 10 '23 14:05 teodargent

It looks like the issue is with nokhwa. Check the link in the comment above. @Twometer

Hi! If it works for you at the end?

oneofthehorses avatar Nov 29 '23 18:11 oneofthehorses

Hi! If it works for you at the end?

No, I used a different app in the end.

teodargent avatar Nov 29 '23 19:11 teodargent

Hi! If it works for you at the end?

No, I used a different app in the end.

Wich one if not secret ?

oneofthehorses avatar Nov 30 '23 05:11 oneofthehorses

nokhwa and image together does not seem to be very stable, I've seen such problems before.

I'll see what the latest compatible version pair is and pin it to that

Twometer avatar Nov 30 '23 08:11 Twometer

Hi! If it works for you at the end?

No, I used a different app in the end.

Wich one if not secret ?

https://bs.parity.io/#/

teodargent avatar Dec 01 '23 00:12 teodargent

I have added a Cargo.lock and locked the image versions, which should fix this problem. Can you try it again, if it works now?

Just run:

$ git pull
$ cargo clean
$ cargo run

Twometer avatar Jan 12 '24 18:01 Twometer