After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 477860 - Pan has trouble displaying large jpegs using gtk+ 2.12
Pan has trouble displaying large jpegs using gtk+ 2.12
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other Mac OS
: Normal critical
: ---
Assigned To: Charles Kerr
Pan QA Team
: 483069 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-09-17 19:51 UTC by devchan1
Modified: 2007-12-09 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to send chunks no larger than 1KB to the pixbuf loader (914 bytes, patch)
2007-10-09 05:38 UTC, Brian Downing
none Details | Review

Description devchan1 2007-09-17 19:51:02 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)
Comment 1 Gregory Lee 2007-09-28 22:09:21 UTC
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
Comment 2 walt 2007-10-04 17:26:48 UTC
Oops, I duplicated this in bug 483069.
Comment 3 devchan1 2007-10-05 11:59:13 UTC
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
Comment 4 Brian Downing 2007-10-09 05:38:58 UTC
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.
Comment 5 devchan1 2007-10-20 03:37:19 UTC
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?




Comment 6 walt 2007-10-25 01:32:59 UTC
*** Bug 483069 has been marked as a duplicate of this bug. ***
Comment 7 walt 2007-11-10 20:34:00 UTC
I filed bug 495703 in an attempt to get some expert advice on how to fix this.
Comment 8 Ed Catmur 2007-12-02 21:49:05 UTC
See bug 494667.
Comment 9 Wade Menard 2007-12-05 05:21:40 UTC
Aaron von Gauss has a patch using 8K chunks in bug 467446
Comment 10 Doug Siddens 2007-12-07 03:27:06 UTC
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.
Comment 11 Matthias Clasen 2007-12-09 19:06:48 UTC
I hope this is fixed now