feat(imagick): make `convert` available in layer
Running convert directly does not work.
For example:
exec('convert --version');
triggers this error:
sh: convert: command not found
This PR makes convert available in the Imagick layer.
Could you tell me why you need convert?
Friendly ping
I'm sorry for the late reply!
My initial though was, if the Imagick Bref extension includes Ghostscript (gs), why not also include convert.
In one of our serverless applications, we used to invoke convert directly, but I didn't realize we could replace this with the PHP Imagick extension. 🙂 For example
-exec("convert compare -metric AE '{$image1}' '{$image2}' NULL:", $output);
-$similarity = (float) $output[0];
+$similarity = (new \Imagick($image1))->compareImages(new \Imagick($image2), \Imagick::METRIC_ABSOLUTEERRORMETRIC)[1];
After these changes, we don't need the imagick binary anymore. But maybe it can be a useful for other use cases?
If you think it's not needed, I'll close this PR 🙂