Closed WalterWoshid closed 2 years ago
Hi @WalterWoshid,
I've not tried php-vips2 in WSL yet, I'll have a quick go. It might be a lavarel issue (perhaps it's not starting up the extension correctly?). The PECL extension should not be necessary, though perhaps that's ensuring that init happens in this case.
Did you try the example programs? Eg.:
https://github.com/libvips/php-vips/blob/master/examples/watermark-text.php
I see:
$ ./watermark-text.php ~/pics/PNG_transparency_demonstration.png x.png "hello world!"
To make:
Ah it seems I can't install WSL2, that's a shame. I run win10 under virtualbox, and it doesn't support nested VMs.
So (just guessing) I think perhaps what's happening is that Lavarel is not pulling in php-vips early enough. Is there some way to change the config to make the vendor autoload happen sooner? That might fix it.
I've trigger the same assertion with a different environment:
GLib-GObject-CRITICAL **: 01:54:46.648: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed
Leading to a SIGSEV child 6 exited on signal 11 (SIGSEGV) after 669.163951 seconds from start
PHP Version: 8.0.17 PHP ini: ffi.enable=true Framework: SlimPHP Environment: Docker (Debian 11) Docker OS: Amazon Linux release 2 (Karoo) libvips-dev: 8.10.5-2 jcupitt/vips: v2.0.1
It does not always occur, only on some requests, identical requests complete fine.
Triggered it a second time, this time with another GLib error
(.:1965): GLib-GObject-WARNING : 02:11:06.006: cannot register existing type 'VipsObject' (.:1965): GLib-CRITICAL : 02:11:06.006: g_once_init_leave: assertion 'result != 0' failed (.:1965): GLib-GObject-CRITICAL : 02:11:06.006: g_type_register_static: assertion 'parent_type > 0' failed (.:1965): GLib-CRITICAL : 02:11:06.006: g_once_init_leave: assertion 'result != 0' failed
The two constructors I am use plus methods are:
Vips\Image::newFromBuffer -> height -> width
Vips\Image::thumbnail_buffer -> height -> width -> writeToBuffer
libvips 8.13 ought to fix this. @WalterWoshid Would you be able to test again?
PHP Version: 8.1.3 PHP ini:
ffi.enable=true
Also true forphp -i
Framework: Laravel 9.4.1 Environment: WSL 2 Docker Docker OS: Ubuntu-20.04libvips-dev
: 8.10.5-2ubuntu1jcupitt/vips
: v2.0.0I'm receiving this error in my console, while trying to run the below code.
(.:21): GLib-GObject-CRITICAL **: 22:13:34.813: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed
It is repeating very fast and also I have to stop PHP, because the request runs for too long.
Edit: The beginning of the logs
EDIT: FIXED
I fixed it by installing the pecl extension for vips
I will let this issue stay open, either this should be documented or there should be a fix?