diff options
author | flavio <fdanesse@gmail.com> | 2012-10-24 21:48:07 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2012-10-24 21:48:07 (GMT) |
commit | 03ac155514625f2380c13712c80eb03d538bcd28 (patch) | |
tree | 18147702355c3b8b5241db5ee38a20d513f7ea54 /resizepics.py | |
parent | 7239fa50950d6667706d6b31675ed631a4b8a496 (diff) |
Port Gtk 3
Diffstat (limited to 'resizepics.py')
-rwxr-xr-x | resizepics.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/resizepics.py b/resizepics.py index 23cee7e..6672c7f 100755 --- a/resizepics.py +++ b/resizepics.py @@ -19,7 +19,9 @@ import getopt import sys import os -import gtk +import gi +from gi.repository import Gtk +from gi.repository import GdkPixbuf import pygame SCREEN_WIDTH = 1200 @@ -36,7 +38,7 @@ def resize_image(filename): if image_width <= SCREEN_WIDTH: resize_to_width = image_width try: - scaled_pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, resize_to_width, ARBITRARY_LARGE_HEIGHT) + scaled_pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filename, resize_to_width, ARBITRARY_LARGE_HEIGHT) scaled_pixbuf.save(filename, "jpeg", {"quality":"%d" % JPEG_QUALITY}) except: print 'File could not be converted' |