Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbar.py
diff options
context:
space:
mode:
Diffstat (limited to 'toolbar.py')
-rw-r--r--toolbar.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/toolbar.py b/toolbar.py
index 782d303..7f69bf7 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -142,11 +142,15 @@ class EditToolbar(Gtk.Toolbar):
temp_path = os.path.join(activity.get_activity_root(), 'instance')
if not os.path.exists(temp_path):
os.makedirs(temp_path)
- fd, file_path = tempfile.mkstemp(dir=temp_path, suffix='.jpg')
+ fd, file_path = tempfile.mkstemp(dir=temp_path, suffix='.png')
os.close(fd)
logging.error('tempfile is %s' % file_path)
- pixbuf_sel.save(file_path, 'jpeg')
- self._abiword_canvas.insert_image(file_path, False)
+ success, data = pixbuf_sel.save_to_bufferv('png', [], [])
+ if success:
+ px_file = open(file_path, 'w')
+ px_file.write(data)
+ px_file.close()
+ self._abiword_canvas.insert_image(file_path, False)
elif clipboard.wait_is_uris_available():
selection = clipboard.wait_for_contents('text/uri-list')