AWS Lambda-node.js-带有imagemagick共享库

AWS Lambda-node.js-带有imagemagick共享库

设置: - AWS Lambda 函数 - 使用 node.js 8.10 运行时 - 使用 AWS 预安装的 imagemagick 库

我在尝试转换 *.AI 文件时遇到的错误:错误:命令失败:转换:无法加载模块/usr/lib64/ImageMagick-6.7.8/modules-Q16/coders/pdf.la': file not found @ error/module.c/OpenModule/1278. convert: no decode delegate for this image format/tmp/magick-c0KvODEy' @ error/constitute.c/ReadImage/544。转换:未定义图像‘/tmp/resized.png’ @ error/convert.c/ConvertImageCommand/3046。

问题:AWS Lambda 函数仍可完美处理 *.JPG 和 *.PNG 文件。但是,在过去 2 周内(自从我们注意到以来),*.AI 文件出现了上述错误。我理解 *.AI 文件由于是 Adob​​e Illustrator 文件而被视为 PDF,因此这就可以理解为什么需要 pdf.la 模块。

问题:看起来 policy.xml 和 delegates.xml 文件需要更改。但是,这可以在 AWS 上使用共享的 imagemagick lib 时实现吗?

最近还有其他人遇到过类似的问题并可以提供什么建议吗?

我现在是否需要将 Ghostscript 包含在 node_module 中?如果是这样,如何将 imagemagick 与 ghostscript 合并(我猜想 node.js 代码将需要更改才能实现)?

感谢您花时间阅读。

相关内容