Re: gdk_pixbuf_new_from_stream



On Wed, Feb 03, 2010 at 09:27:44PM +0100, Martin Kalbfuß wrote:
> I wrote a small test application to check the behavior of
> gdk_pixbuf_new_from_stream. It writes two pixbufs into a stream and then
> tries to read them. png is used as format. The first png is loaded as
> expected. But the second is not. Other reading operations fail, too. The
> stream isn't readable any longer after gdk_pixbuf_new_from_stream.
> That's a big problem, because this is the most important part of my
> nearly finished application. Any ideas what I can do about it?

load_from_stream() does not ensure that no extra data following the
image in the stream are read (in this case the extra data is the other
image).  Namely because this is not possible.

Definitely not with the current loader API -- there's no mechanism to
query the image size in bytes so you simply feed all data you have to
the loader.  Moreover, even the specific format loader cannot always
tell the image size in bytes (think SVG) so adding such query method
might prove problematic.

I am afraid if you have a file consisting of concatenated PNGs you have
to split it to individual images yourself.

Yeti



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]