Skip to content

Instantly share code, notes, and snippets.

@lmr
Created February 27, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmr/2fcfd137dc4e155b2f21 to your computer and use it in GitHub Desktop.
Save lmr/2fcfd137dc4e155b2f21 to your computer and use it in GitHub Desktop.
Possible fix for issue #911
diff --git a/frontend/tko/graphing_utils.py b/frontend/tko/graphing_utils.py
index 10a309c..39525fa 100644
--- a/frontend/tko/graphing_utils.py
+++ b/frontend/tko/graphing_utils.py
@@ -446,8 +446,8 @@ def _create_png(figure):
canvas.draw()
size = canvas.get_renderer().get_canvas_width_height()
image_as_string = canvas.tostring_rgb()
- image = PIL.Image.fromstring('RGB', size, image_as_string, 'raw', 'RGB', 0,
- 1)
+ image = PIL.Image.frombytes('RGB', size, image_as_string, 'raw', 'RGB', 0,
+ 1)
image_background = PIL.Image.new(image.mode, image.size,
figure.get_facecolor())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment