TYPO3 图像处理也适用于 PDF 文件?

TYPO3 image manipulation also for PDF files?

是否可以使用 TYPO3 的图像处理工具在 TYPO3 后端裁剪图像,以便在前端使用 cropVariants 也用于 PDF 文件?

图像处理工具只显示消息:

No image dimensions could be determined.
Unable to provide image manipulation, because original dimensions of the image are unknown.

也许我需要另一个服务器端模块?但是我找不到关于这个主题的任何信息。

is/was ghostscript 存在安全问题,ImageMagick/GraphicsMagick 使用它来处理 PDF 和 EPS。
这就是为什么您会在 IM/GM.

的配置中发现某些发行版中禁用这些文件类型的原因

看图片测试:PDF可以阅读吗? 可能你会发现这样的错误:

Read pdf
Image generation failed
ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error. Please check your settings, especially ['GFX']['processor_path'] and ['GFX']['processor_path_lzw'] and ensure Ghostscript is installed on your server.

this article中您可以获得更多信息。

来自 Ubuntu 分布的示例:
/etc/ImageMagick-6/policy.xml 你找到

<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />

Suse 的另一种解决方法可以在 this TYPO3 ticket 中找到(虽然它不是 TYPO3 的错误)

很可能 TYPO3 中的所有内容都可以正常工作。出于安全原因,出于安全考虑,您的 Unix 发行版禁用了通过 ImageMagick 处理 GhostScript 文件(PDF、AI 等)。

根据您的发行版,有一个文件 /etc/ImageMagick-6/policy.xml。该文件定义允许处理哪些文件。如果你是"save"或者不在乎,注释掉PDF是不允许的。

我的本地设置中有以下部分:

  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />

不允许处理这些文件。都可以包含 GhostScript。 另见:

我不是安全专家,但希望您通过启用对这些文件的处理来解决安全问题。所以也许要确保允许谁上传包含 GhostScript 指令的文件。例如。限制为受信任的后端用户。