Skip to content

Commit

Permalink
Merge pull request #81 from mwcraig/simplify-save
Browse files Browse the repository at this point in the history
Simplify saving image view as PNG
  • Loading branch information
pllim committed Jun 20, 2019
2 parents 83b20d2 + f39c617 commit ea9f722
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions astrowidgets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,11 @@ def scroll_pan(self):
"""
raise NotImplementedError

# https://github.com/ejeschke/ginga/pull/665
def save(self, filename):
"""
Save out the current image view to given PNG filename.
"""
self._viewer.save_rgb_image_as_file(filename)
# It turns out the image value is already in PNG format so we just
# to write that out to a file.
with open(filename, 'wb') as f:
f.write(self._jup_img.value)

0 comments on commit ea9f722

Please sign in to comment.