[英]TYPO3 9 - Image generation failed - ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error
I am using image manipulation TCA type to handle multiple crop variants( https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.6/Feature-75880-ImplementMultipleCroppingVariantsInImageManipulationTool.html ).我正在使用图像处理 TCA 类型来处理多种裁剪变体( https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.6/Feature-75880-ImplementMultipleCroppingVariantsInImageManipulationTool.html )。 But when a user edits and saves the image, the cropped version of the image is not getting saved and also I am not able to fetch the cropped image.但是当用户编辑和保存图像时,图像的裁剪版本没有被保存,我也无法获取裁剪后的图像。
While debugging that, I tried TYPO3 image test.在调试时,我尝试了 TYPO3 图像测试。 But getting following error for multiple operations.但是多次操作出现以下错误。
Image generation failed ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error.图像生成失败 ImageMagick / GraphicsMagick 处理已启用,但执行命令返回错误。 Please check your settings, especially ['GFX']['processor_path'] and ['GFX']['processor_path_lzw'] and ensure Ghostscript is installed on your server.请检查您的设置,尤其是 ['GFX']['processor_path'] 和 ['GFX']['processor_path_lzw'] 并确保您的服务器上安装了 Ghostscript。
I checked the path is right and Ghostscript is also installed on the server.我检查了路径是否正确,并且服务器上也安装了 Ghostscript。
Code to integrate mobile image manipulation集成移动图像处理的代码
'config' => [
'type' => 'imageManipulation',
'cropVariants' => [
'mobile' => [
'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.mobile',
'allowedAspectRatios' => [
'4:3' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
'value' => 4 / 3
],
'NaN' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
'value' => 0.0
],
],
],
'desktop' => [
'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.desktop',
'allowedAspectRatios' => [
'4:3' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
'value' => 4 / 3
],
'NaN' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
'value' => 0.0
],
],
],
]
]
To Render Crop varient I am using following code为了渲染作物变量,我使用以下代码
`<f:image image="{data.image}" cropVariant="mobile" width="800" />`
Following error, I am getting while doing Image test以下错误,我在做图像测试时得到
Image generation failed ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error.图像生成失败 ImageMagick / GraphicsMagick 处理已启用,但执行命令返回错误。 Please check your settings, especially ['GFX']['processor_path'] and ['GFX']['processor_path_lzw'] and ensure Ghostscript is installed on your server.请检查您的设置,尤其是 ['GFX']['processor_path'] 和 ['GFX']['processor_path_lzw'] 并确保您的服务器上安装了 Ghostscript。
-bash: /usr/bin/convert: No such file or directory
can result from different errors: -bash: /usr/bin/convert: No such file or directory
不同的错误-bash: /usr/bin/convert: No such file or directory
导致-bash: /usr/bin/convert: No such file or directory
:
1st:第一:
there really is no executable.真的没有可执行文件。
Make sure IM or GM is installed and provide the correct path in the TYPO3 configuration.确保已安装 IM 或 GM 并在 TYPO3 配置中提供正确的路径。
Maybe only the path is wrong.也许只是路径不对。
2nd:第二:
the executable is there, but the web-user (apache-user) has no access to the executables.可执行文件在那里,但网络用户(apache-user)无法访问可执行文件。
Make sure the user has access like chmod +x /usr/bin/convert
确保用户具有访问权限,如chmod +x /usr/bin/convert
@Shabnam: if you didn't solve this issue yet: I had the same problem and after some debugging found out it is the setting -auto-orient
that was added in Typo3 9 as parameter to 'convert', that was causing the problem. @Shabnam:如果你还没有解决这个问题:我遇到了同样的问题,经过一些调试发现它是在Typo3 9中添加的设置-auto-orient
作为“转换”的参数,这导致了问题.
If you remove this setting in the following files, your image tests will probably succeed:如果您在以下文件中删除此设置,您的图像测试可能会成功:
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php (change to public $scalecmd = '-geometry';)
typo3/sysext/core/Classes/Utility/CommandUtility.php (remove $parameters = '-auto-orient ' . $parameters;)
I also came across this question.我也遇到过这个问题。 None of the above things worked for me.以上这些都不适合我。 Running the same command as the TYPO3 install tool on console showed an error message:在控制台上运行与 TYPO3 安装工具相同的命令显示错误消息:
convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
In the end this worked for me: ImageMagick security policy 'PDF' blocking conversion最后这对我有用: ImageMagick security policy 'PDF'blocking conversion
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.