diff options
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' |