Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2016 22:04
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 anonymous/4350b60dbe3c5a347586e4e3951c1b00 to your computer and use it in GitHub Desktop.
Save anonymous/4350b60dbe3c5a347586e4e3951c1b00 to your computer and use it in GitHub Desktop.
--- 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