In my Node.js functions, I have code that calls convert
, which used to work but is now failing because it cannot find ImageMagick's convert
command. What happened? Is there a way around this?
const args = [tempIn, "-thumbnail", "'258x258>'", tempOut];
spawnSync("convert", args, { encoding: "utf8", shell: true }); // error
// stderr: /bin/sh: 1: convert: not found
I'm aware that this command was changed to magick
in ImageMagick version 7. It doesn't work with that command either. I'm also aware of supposedly current documentation that indicates the convert
command is still installed.
ImageMagick and its command-line tool
convert
are included by default within the Google Cloud Functions execution environment for most of the runtimes. For PHP, you may need to do some manual configuration.
I also see there are questions on StackOverflow from 2019 mentioning npm packages such as GraphicsMagick for use with Firebase Functions. However, these packages presuppose the existence of the ImageMagick on the base system, which does not appear to be the case for me.
Lastly, I'm aware that there are and have been Firebase extensions for creating thumbnails, but for various reasons, I cannot use them.