[cairo-commit] pycairo/examples/gtk png_view.py,1.3,1.4

Steve Chaplin commit at pdx.freedesktop.org
Wed Apr 27 18:46:38 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/examples/gtk
In directory gabe:/tmp/cvs-serv6212/examples/gtk

Modified Files:
	png_view.py 
Log Message:
SC

Index: png_view.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/png_view.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- png_view.py	14 Apr 2005 12:05:26 -0000	1.3
+++ png_view.py	28 Apr 2005 01:46:36 -0000	1.4
@@ -24,13 +24,9 @@
 
 filename = sys.argv[1]
 
-try:
-    file_object = file(filename)
-    surface, wh = cairo.ImageSurface.create_for_png(file_object)
-    Width, Height = wh
-    file_object.close()
-except Exception, exc:
-    raise SystemExit(exc)
+surface = cairo.ImageSurface.create_from_png(filename)
+Width  = surface.width
+Height = surface.height
 
 win = gtk.Window()
 win.connect('destroy', lambda x: gtk.main_quit())
@@ -43,8 +39,3 @@
     
 win.show_all()
 gtk.main()
-
-# Bug #2972
-# seg fault on exit caused by cairo_image_surface.create_for_png()
-# calling fclose()
-#print 'end of script'




More information about the cairo-commit mailing list