Created
December 18, 2016 22:04
-
-
Save anonymous/4350b60dbe3c5a347586e4e3951c1b00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- terminatorlib/plugins/terminalshot.py 2016-12-19 03:13:42.239414906 +0530 | |
+++ ./terminalshot.py 2016-12-19 03:13:30.326005677 +0530 | |
@@ -6,6 +6,7 @@ terminals""" | |
import os | |
from gi.repository import Gtk | |
+from gi.repository.GdkPixbuf import InterpType | |
import terminatorlib.plugin as plugin | |
from terminatorlib.translation import _ | |
from terminatorlib.util import widget_pixbuf | |
@@ -43,8 +44,8 @@ class TerminalShot(plugin.MenuItem): | |
pixbuf = orig_pixbuf.scale_simple(orig_pixbuf.get_width() / 2, | |
orig_pixbuf.get_height() / 2, | |
- GdkPixbuf.InterpType.BILINEAR) | |
- image = Gtk.image_new_from_pixbuf(pixbuf) | |
+ InterpType.BILINEAR) | |
+ image = Gtk.Image.new_from_pixbuf(pixbuf) | |
savedialog.set_preview_widget(image) | |
savedialog.show_all() | |
@@ -53,6 +54,6 @@ class TerminalShot(plugin.MenuItem): | |
if response == Gtk.ResponseType.OK: | |
path = os.path.join(savedialog.get_current_folder(), | |
savedialog.get_filename()) | |
- orig_pixbuf.save(path, 'png') | |
+ orig_pixbuf.savev(path, 'png', [], []) | |
savedialog.destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment