You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
OS: Linux, Ubuntu 20.04
libzbar0: 0.23-1.3
pyzbar 0.1.9
python 3.9
Traceback:
ValueError Traceback (most recent call last)
/tmp/ipykernel_957744/3082549785.py in <module>
1 from pyzbar import pyzbar
----> 2 decoded = pyzbar.decode(gray_image)
3 decoded
~/.virtualenvs/py397/lib/python3.9/site-packages/pyzbar/pyzbar.py in decode(image, symbols)
232 raise PyZbarError('Unsupported image format')
233 else:
--> 234 results.extend(_decode_symbols(_symbols_for_image(img)))
235
236 return results
~/.virtualenvs/py397/lib/python3.9/site-packages/pyzbar/pyzbar.py in _decode_symbols(symbols)
125
126 if zbar_symbol_get_orientation:
--> 127 orientation = ZBarOrientation(zbar_symbol_get_orientation(symbol)).name
128 else:
129 orientation = None
/usr/local/lib/python3.9/enum.py in __call__(cls, value, names, module, qualname, type, start)
382 """
383 if names is None: # simple value lookup
--> 384 return cls.__new__(cls, value)
385 # otherwise, functional API: we're creating a new Enum type
386 return cls._create_(
/usr/local/lib/python3.9/enum.py in __new__(cls, value)
700 ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__))
701 if result is None and exc is None:
--> 702 raise ve_exc
703 elif exc is None:
704 exc = TypeError(
ValueError: 4294967295 is not a valid ZBarOrientation
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 as 4294967295?
The text was updated successfully, but these errors were encountered:
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 -1here. 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.
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
?The text was updated successfully, but these errors were encountered: