首页 > 解决方案 > 在 Google Cloud Functions 上使用 GraphicsMagick (GM) 操作 PDF 时出现权限错误

问题描述

我在 Google Cloud 上创建了一个函数,该函数在将图像上传到 Google Cloud Storage 后对其进行操作。

该功能适用​​于我需要支持的几乎所有图像类型,除非我处理 PDF。我正在尝试将 PDF 转换为图像,但出现以下错误:

Failed to resize path/75/ae4d8a49-ea8e-4473-a679-14a372e2afba_rear.pdf. Error: Command failed: identify-im6.q16: not authorized `/tmp/ae4d8a49-ea8e-4473-a679-14a372e2afba_rear.pdf' @ error/constitute.c/ReadImage/412.

谷歌搜索此错误后,我发现与政策有关,并建议编辑policy.xml文件(https://cromwell-intl.com/open-source/pdf-not-authorized.html)。但是,这在 Google Cloud Function 中似乎是不可能的。

关于如何在 Google Cloud Functions 中操作 PDF 的任何想法?

注意:这可能与谷歌云功能权限问题有关

标签: pdfgoogle-cloud-platformgoogle-cloud-functionsgraphicsmagick

解决方案


推荐阅读