Re: occur error when use GdkPixbuf savev method in gjs
- From: "Alan Knowles" <alan akbkhome com>
- To: "Yuren Ju" <javascript-list-bounces gnome org>
- Cc: javascript-list gnome org
- Subject: Re: occur error when use GdkPixbuf savev method in gjs
- Date: Tue, 29 Mar 2011 15:32:43 +0800
Check what the introspection data for GdkPixbuf savev is declared as.
I suspect it's broken (needs fixing upstream)
The last two arguments are supposed to be arrays and defined like this.
<array c:type="gchar**">
<type name="utf8"/>
</array>
the copy I have for that file (is a bit old so it might have been fixed) shows this.
<parameter name="option_keys" transfer-ownership="none">
<doc xml:whitespace="preserve">name of options to set, %NULL-terminated</doc>
<type name="utf8" c:type="char**"/>
</parameter>
If the gir is correct the correct syntax is probably
pb.savev("screenshot.jpg", "jpeg", [], []);
Regards
Alan
--- On 29/Mar/2011, Yuren Ju wrote:
> Dear all,
>
> I want to use savev to save a pixbuf to png/jpeg without options, but occur
> some problem:
>
> pb.savev("screenshot.jpg", "jpeg", null, null);
>
> I try to fill null, empty String or array but still occur different problem
> like "may not be null", "Unrecognized parameter () passed to JPEG saver".
>
> and also found if use seed javascript framework, i can use
> pb.save("filename", "jpeg") to save pixbuf. (but i want to write a
> gnome-shell extension, so needing to use gjs)
>
> any idea for this problem?
>
> my GTK version is 3.0.2-70.3
>
> Thanks,
> Yuren
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]