Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError: Python integer 256 out of bounds for uint8 #21

Open
EUA opened this issue Nov 30, 2024 · 1 comment
Open

OverflowError: Python integer 256 out of bounds for uint8 #21

EUA opened this issue Nov 30, 2024 · 1 comment

Comments

@EUA
Copy link

EUA commented Nov 30, 2024

It was working before but... When I try now, it complains from uint8 overflow.
only with tc001v4.2.py. RAW one works proper.

Traceback (most recent call last):
  File "/home/compile/PyThermalCamera/src/./tc001v4.2.py", line 108, in <module>
    lo = lo*256
         ~~^~~~
OverflowError: Python integer 256 out of bounds for uint8
@arjayW
Copy link

arjayW commented Dec 8, 2024

Not sure if this is because of the code design specifically laid out for a RPi.
I fixed this on SteamOS by doing a conversion and it appears that all resulting values are correct.
Ideally the code should be tested against multiple distros with dedicated methods such as is_raspberrypi() is doing.

lo = lo.astype(np.uint16) * 256

There may be better ways to do this. And converting all parameters that are affected by the out of bonds multplication is required for:
lo, lomax, lomin, loavg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants