Skip to content

Commit

Permalink
Explicit cast using np.add. Fixes dependency on deprecated numpy beha…
Browse files Browse the repository at this point in the history
…viour, as described in gizeh issue Zulko#25 and numpy issue #7225
  • Loading branch information
bitblomster committed Jan 30, 2018
1 parent 8d6db5b commit 6172ef7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gizeh/gizeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def from_image(image):
image = np.dstack([image, 255 * np.ones((h, w))])
sf = Surface(w, h)
arr = np.frombuffer(sf._cairo_surface.get_data(), np.uint8)
arr += image.flatten()
np.add(arr, image.flatten(), out=arr, casting="unsafe")
sf._cairo_surface.mark_dirty()
return sf

Expand Down

0 comments on commit 6172ef7

Please sign in to comment.