Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/6.1-opw-573456-xal into 
lp:openobject-client/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/6.1-opw-573456-xal/+merge/103437

Hi,

When displaying image within the GTK client using "image" widget, sometime the 
image appears as empty. This is especially the case on Win7, but the problem 
happens all the time.

The MP fix the usage of gtk.gdk.PixbufLoader() by forcing a "close" before 
trying to get the image pixbuf.

Before as close() was happening later-on, there is a short period of time where 
the PixbufLoader() might not have processed the picure; period of time where 
get_pixbuf() return None. That lead the GTK client think there is no valid 
picture of that format, which is wrong.

Regards,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/6.1-opw-573456-xal/+merge/103437
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/6.1-opw-573456-xal.
=== modified file 'bin/widget/view/form_gtk/image.py'
--- bin/widget/view/form_gtk/image.py	2011-09-26 12:53:49 +0000
+++ bin/widget/view/form_gtk/image.py	2012-04-25 10:11:19 +0000
@@ -185,6 +185,7 @@
             loader = gtk.gdk.PixbufLoader(type)
             try:
                 loader.write(data, len(data))
+                loader.close()
             except:
                 continue
             pixbuf = loader.get_pixbuf()
@@ -193,10 +194,9 @@
         if not pixbuf:
             loader = gtk.gdk.PixbufLoader('png')
             loader.write(NOIMAGE, len(NOIMAGE))
+            loader.close()
             pixbuf = loader.get_pixbuf()
 
-        loader.close()
-
         img_height = pixbuf.get_height()
         if img_height > self.height:
             height = self.height

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to