簡體   English   中英

TYPO3 9 - 圖像生成失敗 - ImageMagick / GraphicsMagick 處理已啟用,但執行命令返回錯誤

[英]TYPO3 9 - Image generation failed - ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error

我正在使用圖像處理 TCA 類型來處理多種裁剪變體( https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.6/Feature-75880-ImplementMultipleCroppingVariantsInImageManipulationTool.html )。 但是當用戶編輯和保存圖像時,圖像的裁剪版本沒有被保存,我也無法獲取裁剪后的圖像。

在調試時,我嘗試了 TYPO3 圖像測試。 但是多次操作出現以下錯誤。

圖像生成失敗 ImageMagick / GraphicsMagick 處理已啟用,但執行命令返回錯誤。 請檢查您的設置,尤其是 ['GFX']['processor_path'] 和 ['GFX']['processor_path_lzw'] 並確保您的服務器上安裝了 Ghostscript。

我檢查了路徑是否正確,並且服務器上也安裝了 Ghostscript。

集成移動圖像處理的代碼

 '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
                             ],
                         ],
                     ],
                 ]
            ]

為了渲染作物變量,我使用以下代碼

`<f:image image="{data.image}" cropVariant="mobile" width="800" />`

以下錯誤,我在做圖像測試時得到

圖像生成失敗 ImageMagick / GraphicsMagick 處理已啟用,但執行命令返回錯誤。 請檢查您的設置,尤其是 ['GFX']['processor_path'] 和 ['GFX']['processor_path_lzw'] 並確保您的服務器上安裝了 Ghostscript。

-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

第一:
真的沒有可執行文件。
確保已安裝 IM 或 GM 並在 TYPO3 配置中提供正確的路徑。
也許只是路徑不對。

第二:
可執行文件在那里,但網絡用戶(apache-user)無法訪問可執行文件。
確保用戶具有訪問權限,如chmod +x /usr/bin/convert

@Shabnam:如果你還沒有解決這個問題:我遇到了同樣的問題,經過一些調試發現它是在Typo3 9中添加的設置-auto-orient作為“轉換”的參數,這導致了問題.

如果您在以下文件中刪除此設置,您的圖像測試可能會成功:

typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php (change to public $scalecmd = '-geometry';)
typo3/sysext/core/Classes/Utility/CommandUtility.php (remove $parameters = '-auto-orient ' . $parameters;)

我也遇到過這個問題。 以上這些都不適合我。 在控制台上運行與 TYPO3 安裝工具相同的命令顯示錯誤消息:

convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.

最后這對我有用ImageMagick security policy 'PDF'blocking conversion

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM