Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)' failed in vips 8.9 on amazon linux when saving to a gif file #1524

Closed
chregu opened this issue Jan 13, 2020 · 6 comments

Comments

@chregu
Copy link

chregu commented Jan 13, 2020

In vips 8.9, I get the following error, when saving to a GIF

$ vips resize some.jpg lala.gif 1
(vips:8): GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)' failed

It does save the gif, 'though, but still a little bit worried.
It doesn't warn, when the input is a GIF as well.
And the warning didn't exist in vips 8.8

And I don't see that warning on a Ubuntu Xenial Image, but only on Amazon Linux (1, not 2), with glib 2.36.3, the xenial one has 2.48.0. But not sure, that's the problem.

Tried to debug it a little, but didn't get much out of it

$  export G_DEBUG=fatal_warnings
$ gdb /usr/local/bin/vips
# run resize some.jpg lala.gif 1
(vips:175): GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)' failed
Program received signal SIGTRAP, Trace/breakpoint trap.
(gdb) bt
#0  0x00007f7281525d3d in g_logv () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f7281525f22 in g_log () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f7287734070 in vips_foreign_save_magick_dispose () from /usr/local/imagemagick/lib/libvips.so.42
#3  0x00007f72818132a8 in g_object_unref () from /usr/lib64/libgobject-2.0.so.0
#4  0x00007f728778ac90 in vips_call_split_option_string () from /usr/local/imagemagick/lib/libvips.so.42
#5  0x00007f728777e96c in vips_image_write_to_file () from /usr/local/imagemagick/lib/libvips.so.42
#6  0x00007f7287779745 in vips_object_get_argument_to_string () from /usr/local/imagemagick/lib/libvips.so.42
#7  0x00007f728778994d in vips_call_argv_output () from /usr/local/imagemagick/lib/libvips.so.42
#8  0x00007f7287777f0a in vips_argument_map () from /usr/local/imagemagick/lib/libvips.so.42
#9  0x00007f728778adbd in vips_call_argv () from /usr/local/imagemagick/lib/libvips.so.42
#10 0x000000000040223b in main ()

I guess that one is hard to debug, but if you need more input, I can try to provide it.

@chregu
Copy link
Author

chregu commented Jan 13, 2020

Looks like it happens, when "delay" is not set. In PHP code:

$vips = \Jcupitt\Vips\Image::newFromFile("some.jpg")->copy();
$vips->set("delay",[1]);
$vips->magicksave("foo.gif");

does get rid of the warning

(but using $vips->set("gif-delay",1); doesn't)

Does delay have to be set "manually" for saving gifs now? And is gif-delay as a global value still supported or do I have to convert that to the delay array notation with vips 8.9?

@chregu
Copy link
Author

chregu commented Jan 13, 2020

One more observation. The warning comes with any format when I use magicksave, but disappears always when I set the delay property. No matter what the input is.

$ vips MagickSave foo.jpg lala.jpg

(vips:2020): GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)' failed

@jcupitt
Copy link
Member

jcupitt commented Jan 13, 2020

Hi @chregu, yes, this looks like a bug. I'll investigate. Thanks!

jcupitt added a commit that referenced this issue Jan 13, 2020
we were leaving delay_gvalue as {0} then unsetting it, which will
produce a warning with some versions of glib.

Thanks chregu.

See #1524
@jcupitt
Copy link
Member

jcupitt commented Jan 13, 2020

I think it's fixed. The warning was harmless, but of course it's good to fix it.

Yes, the old gif-delay property is still supported. It is ignored if delay is defined.

@jcupitt
Copy link
Member

jcupitt commented Jan 13, 2020

And thanks for reporting this!

@chregu
Copy link
Author

chregu commented Jan 13, 2020

The warning is gone. Thanks a lot.

@chregu chregu closed this as completed Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants