gizeh icon indicating copy to clipboard operation
gizeh copied to clipboard

I find problem in Surface.from_image() function....

Open LQY404 opened this issue 3 years ago • 0 comments

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.

LQY404 avatar Mar 10 '21 01:03 LQY404