l1npengtul / nokhwa

Cross Platform Rust Library for Powerful Webcam/Camera Capture
Apache License 2.0
482 stars 111 forks source link

Cannot compile on Windows in any version #132

Open Julien-cpsn opened 1 year ago

Julien-cpsn commented 1 year ago

Hello, I tried de compile the library from version 0.10.0 to 0.10.4 but nothing worked out. I am using cargo 1.70.0, rustup 1.26.0 and rustc 1.70.0 on Windows 11 22621.1848. I am also using tauri but it does not change the fact that compilation doesn't work.

Here are the two errors : image

I did use the suggestions from cargo and now its working like a charm!

From: https://github.com/l1npengtul/nokhwa/blob/cab61c5750085df9ebb812269caf05f48d14b51d/nokhwa-core/src/traits.rs#L226 https://github.com/l1npengtul/nokhwa/blob/cab61c5750085df9ebb812269caf05f48d14b51d/nokhwa-core/src/traits.rs#L227

To:

bytes_per_row: Some(width_nonzero),
rows_per_image: Some(height_nonzero),

Have a great day

jilchab commented 1 year ago

Same thing on Mac OS 13

LunaticWyrm467 commented 11 months ago

I'm also experiencing this issue, and I can confirm that this fix does work.