[pygtk] PixbufLoader: Application transferred too few scanlines

Thomas Guettler guettli at thomas-guettler.de
Thu Feb 21 21:57:06 WST 2008


After the update to Ubuntu 7.10 (python-gtk2 2.12.0-0ubuntu2) loading of
(large) images fail. The jpeg is not corrupt, it could be displayed with
the same code before the update.

===> LANG=C python /home/guettli/tmp/t.py 
Traceback (most recent call last):
  File "/home/guettli/tmp/t.py", line 6, in <module>
    p.close() 
gobject.GError: Error interpreting JPEG image file (Application transferred too few scanlines)

# t.py:
import gtk
p = gtk.gdk.PixbufLoader()
data =
open("/home/guettli/pictures/ixus/2008-02-09/IMG_6516.JPG").read() # Fails, Size: 2MB, same with 200KByte file.
#data = open("t.jpg").read() # OK size 1,6K
p.write(data)
p.close() 

I read the documentation again, and think that the code is OK:
http://www.pygtk.org/docs/pygtk/class-gdkpixbufloader.html

Somewhere I read, that you need to pipe in several small chunks instead of
one big. With the chunksize of  5*10**4 I get no error. But with 5*10**5 (500KByte)
I get this.

Now I know how to get around this error, but I think the documentation or gtk should
be improved.

 Thomas


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de



More information about the pygtk mailing list