GNOME Bugzilla – Bug 477860
Pan has trouble displaying large jpegs using gtk+ 2.12
Last modified: 2007-12-09 19:06:48 UTC
Compile pan with the latest version of gtk 2.12. View any large jpeg 1200x1000 or larger in size from any newsgroup eg. alt.binaries.*.wallpapers. Pan will only display the upper half of the image. The pan events log reports: Error interpreting JPEG image file (Application transferred too few scanlines)
I see this bug, and I'm using gtk+-2.11.6. Pan user stevem reported on the Pan users mailing list: "Rolled libgtk back to 2.10.13-1 and problem solved." It seems a reasonable guess, then, that the problem was introduced with gtk+ 2.11. Greg
Oops, I duplicated this in bug 483069.
Discussion pertaining to this bug on the pan.users mailing list: http://comments.gmane.org/gmane.comp.gnome.apps.pan.user/9282 http://thread.gmane.org/gmane.comp.gnome.apps.pan.user/9282
Created attachment 96917 [details] [review] Patch to send chunks no larger than 1KB to the pixbuf loader I started working under the assumption that this bug has something to do with bug 441443. First of all, this happens even in single-part posts. It appears to happen whenever the JPEG data is larger than a certain size. If I added code to get_pixbuf_from_gmime_part to write out buffer->data to a file, I got a perfectly fine image, despite the fact that the pixbuf_loader barfed on the same data. From this, I experimentally came up with the attached patch. It loads 1024 bytes at a time into the pixbuf loader. I was expecting this to perhaps narrow down where the problem was. Amazingly, this makes the problem go away! While it's nice to be able to look at images again, I think this really points to a bug in the pixbuf loader. I'll post a comment over in bug 441443 referencing this. Regardless, I think this patch is a safe workaround, even if it shouldn't be neccessary. The code may need to be restyled, as I don't usually write GTK or Gnome code.
I have been experimenting with gdk-pixbuf. What I find is the following: in the file gtk+2.12.x/gdk-pixbuf/io-jpeg.c there is the statement #define JPEG_PROG_BUF_SIZE 65536 if you change its value to something significantly higher, such as #JPEG_PROG_BUF_SIZE 500000 then it seems the decoding problems go away. Can someone with some knowledge of gtk please comment on this?
*** Bug 483069 has been marked as a duplicate of this bug. ***
I filed bug 495703 in an attempt to get some expert advice on how to fix this.
See bug 494667.
Aaron von Gauss has a patch using 8K chunks in bug 467446
I noticed that this bug is indicated for Mac OS. I'm experiencing it on Ubuntu 7.10 on a HP dv8000 AMD 64 laptop.
I hope this is fixed now