gizeh
gizeh copied to clipboard
I find problem in Surface.from_image() function....
the probelm is: when i use a image, to initial the Surface, error was arise: UFuncTypeError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'
after look for the source code, I find the problem of source code:
np.dstack([image, 255 * np.ones((h, w))])
the input image' shape is [w, h, 3], type is np.uint8
I change the code to:
np.dstack([image, 255 * np.ones((h, w), dtype=np.uint8)])
the problem is disappear.