rxing-core / rxing

cRustacean Crossing
https://crates.io/crates/rxing
Apache License 2.0
198 stars 19 forks source link

Index out of bounds in FitQadrilateralToPoints try_get_range #36

Open dankirkham opened 11 months ago

dankirkham commented 11 months ago
panicked at /Users/dan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rxing-0.4.9/src/common/cpp_essentials/concentric_finder.rs:393:25:
slice index starts at 18 but ends at 17
...

This will happen occasionally while trying to detecting codes in wasm.

dankirkham commented 11 months ago

I made sure that my luma input was a square image and I am able to scan barcodes now. I have not encountered the error since.

hschimke commented 11 months ago

I'll look into this. Do you happen to have any images that trigger the error?

hschimke commented 11 months ago

I have a potential solution, but it only addresses the error and not whatever root cause results in it happening. If you have an image that causes it you can safely upload to be added to the test suite that would be very helpful.

Alternatively, if your use-case is images that you do not want public and cannot share, I can provide a GitHub branch with the potential solution for you to test.

hschimke commented 11 months ago

@dankirkham I bundled this, and a few other changes, into rxing 0.4.11, which is the backing version for the NPM package version 0.1.26. If you continue to see the issue please reach out.