[cairo-commit] [cairo-www] src/gdkpixbufpycairo.mdwn

Carl Worth cworth at freedesktop.org
Sat Feb 23 10:07:54 PST 2008


 src/gdkpixbufpycairo.mdwn |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit f7e25ef950403c1b0f1fd1f98fcf203362d5f005
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Feb 23 10:07:41 2008 -0800

    More simplification with gtk.gdk.pixbuf_new_from_file

diff --git a/src/gdkpixbufpycairo.mdwn b/src/gdkpixbufpycairo.mdwn
index a414ab5..5cd06a2 100644
--- a/src/gdkpixbufpycairo.mdwn
+++ b/src/gdkpixbufpycairo.mdwn
@@ -19,12 +19,7 @@ Can be used as a very primitive image viewer.
 
     def main():
       filename = sys.argv[1]
-      input = open(filename)
-      imagebuf = input.read()
-      pixbufloader = gtk.gdk.PixbufLoader()
-      pixbufloader.write(imagebuf)
-      pixbufloader.close()
-      pixbuf = pixbufloader.get_pixbuf()
+      pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
       imgw=pixbuf.get_width()
       imgh=pixbuf.get_height()
       win = gtk.Window()


More information about the cairo-commit mailing list