Skip to content

Commit

Permalink
make sure to read bytes for image
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Apr 6, 2018
1 parent cf82f4e commit f6b665d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nglview/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from traitlets import (Unicode, Bool, Dict, List, Int, Integer, observe,
CaselessStrEnum)

from .utils import py_utils, js_utils, widget_utils
from .utils import py_utils, widget_utils
from .utils.py_utils import (seq_to_string, _camelize_dict, FileManager,
get_repr_names_from_dict, encode_base64,
_update_url)
Expand Down Expand Up @@ -1388,7 +1388,8 @@ def _display_image(self):
'''for testing
'''
from IPython import display
return display.Image(self._image_data)
im_bytes = base64.b64decode(self._image_data)
return display.Image(im_bytes)

def _clear_component_auto_completion(self):
for index, _ in enumerate(self._ngl_component_ids):
Expand Down

0 comments on commit f6b665d

Please sign in to comment.