Dear Lazyweb: Gtk+ need GDI+ help!

As you may remember, I kick started a native GdkPixbuf loader in windows a while ago, Dom brought it to an acceptable state and eventually it got merged to Gtk+. The aim of this pixbuf loader is to reduce the number of dependencies.

Now, we’ve found a quite intriguing bug in it (#552678). Basically, it seems that when an image, say a jpeg, is bigger than the buffer size of the pixbuf loader, the image won’t be loaded.

If there are any GDI+ experts around that can figure out what’s wrong in our code, the Win32 team would be really greatful. You can find a testcase attached to the bug.

Cheers!

Advertisements

3 thoughts on “Dear Lazyweb: Gtk+ need GDI+ help!

  1. After playing with it a bit it looks like GDI+ is doing some lazy JPEG decoding. The windbg stacktrace says it is faulting in a OLE32!CMemStm::Read call. So, it looks like it thinks the IStream is still valid. If you add a GetPixel call in gdip_buffer_to_bitmap everything works fine. I’m guessing this causing GDI+ to do the JPEG decode then, rather than after you’ve freed the IStream. I couldn’t find any docs on saying how long the IStream should be valid for that API call though. hope that helps.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s