luispedro / mahotas

Computer Vision in Python
https://mahotas.rtfd.io
Other
846 stars 148 forks source link

fix: numpy 2.0 compatybility (`array.max()` dtype problem) #150

Closed Czaki closed 4 months ago

Czaki commented 4 months ago

I found in my tests that since numpy 2.0 the data.max() returns the same dtype as array data. So for array of type np.uint8 and max value 255 it leads to create cmat of size 0, 0.

This PR converts size to int before increasing it by 1.

luispedro commented 4 months ago

Thanks! And really I appreciate that you added a test too!