Perhaps two different versions of crate `image` are being used?
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
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.
It looks like the issue is with nokhwa. Check the link in the comment above. @Twometer
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?
Hi! If it works for you at the end?
No, I used a different app in the end.
Hi! If it works for you at the end?
No, I used a different app in the end.
Wich one if not secret ?
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
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/#/
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