Replies: 2 comments
-
Hello @web-apply, It looks like you are using the old php-vips-ext module -- this is not supported! Please use php-vips. php-vips is synchronous, so (for example) You'd need several processes if you want asynchronous operations, with perhaps a job queue. I've used DB tables to implement this in the last, perhaps there's something better now. |
Beta Was this translation helpful? Give feedback.
-
Have a look at Gearman (PHP ext is https://github.com/php/pecl-networking-gearman) |
Beta Was this translation helpful? Give feedback.
-
I'm doing a small image conversion. png to jpg
$x = vips_image_new_from_file("X.PNG",['access' => 'sequential'])["out"];
try {
if(vips_image_write_to_file($x,"indir/$filename.JPG",["Q"=>$kalite])==True) {
echo " Converted to successfully ";
} else { throw new Exception("File writing problem i am not sync"); }
}
catch(Exception $e) {
echo 'Message: ' .$e->getMessage();
}
I'm doing a small image conversion. However, I think libvips works asynchronously and does not block php. So throw new Exception("File writing problem i am not sync"); I get an error.
How can I wait for this process to finish?
PHP 8.1 JIT enabled
Beta Was this translation helpful? Give feedback.
All reactions