Open purplesword opened 2 years ago
This issue affects me as well, I've done a little more digging and I think I've found the problematic lines. The ZBarOrientation
enum class specifies an UNKNOWN
type as -1
here. However, when setting zbar_symbol_get_orientation
, the c_uint
type is passed here. Presumably if this was changed to c_int
this would solve this issue?
Not sure if this library is maintained at all anymore, but providing this info just in case.
Same issue ...
I concur with the analysis that it is caused by the ZBarOrientation
UNKNOWN
(-1
) being interpreted as unsigned integer.
It seems the exception is thrown after the QR code has been decoded. Therefore, one can set a breakpoint at the line causing the exception:
https://github.com/NaturalHistoryMuseum/pyzbar/blob/ff2892666fa7cd305f0a95f9808159809c6fc222/pyzbar/pyzbar.py#L127
and look at the data
variable in a debugger. It should show the QR code data.
I also found a QR code online that causes this problem. The one on the bottom right here:
Hi, on a few rare occasions I got
ValueError: 4294967295 is not a valid ZBarOrientation
on some images. I assume it was due to-1
assigned to uint and got stored as UINT_MAX?Enviroment:
Traceback:
Unfortunately I cannot share the original bug doc due to privacy. I will try if I can reproduce the error on some shareable anonymized image. But I guess it's some
-1
treated as4294967295
?