Re: GdkPixbufLoader size-prepared troubles



On 08/12/2010 02:27 PM, Jim Hayward wrote:
Quoting from the docs, "area_prepared", will be called as soon as the
pixbuf of the desired has been allocated. You can obtain it by calling
gdk_pixbuf_loader_get_pixbuf(). If you want to use it, simply ref it. In
addition, no actual information will be passed in yet".

 From that I would expect that no image data is written until
area-updated is called. I wouldn't expect a call to
gdk_pixbuf_loader_get_pixbuf() to produce a displayable image in
area-prepared.

That's right, but it does get filled in with more data as the loader progresses. Every time my area-updated handler is called I update the display and can see the image progressively load. The problems only started when I tried to scale the image with gdk_pixbuf_loader_set_size().

I still find it strange that you are seeing multiple size-prepared
signals. I've only ever seen it emitted once and from the docs I would
only expect to see it once.

Strange indeed.

Are you making multiple calls to gdk_pixbuf_loader_write()? I've never
tried it. but according to the docs...

"This will cause a pixbuf loader to parse the next count bytes of an
image."

Yes, this is exactly what I am doing. And again, it worked fine until I tried to scale.

I've never tried to progressively load the image. Your seeing only one
area-updated signal does make it sound like progressively loading and
scaling the image with gdk_pixbuf_loader_set_size() is not supported.

Yeah, I've resigned myself to this conclusion. It looks like I'll just have to do my own scaling and pass that to the pixbuf loader to accomplish what I need.

Thanks for all your help, Jim.

Regards,
--
Alesh Slovak                    Linux Team -- AVASYS Corporation
alesh slovak avasys jp          http://avasys.jp


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