【发布时间】:2012-11-14 09:21:07
【问题描述】:
我要搬到一家新的托管公司,该公司不允许我为 ImageMagick 执行 convert 命令。所以我现在必须尝试通过直接的 PHP 来实现。我花了相当多的时间试图弄清楚它,我看到的每一个地方,人们都建议像我一样使用convert 命令。我将不胜感激在直接 PHP 中编写以下命令的任何帮助或指导。
# Applies overlay $filter_image to the original $image
convert $image ( -clone 0 -alpha off $filter_image -compose SoftLight -composite ) -compose SrcIn -composite $output_image
和
# Apply a blur to an image
convert $image -blur 0x$blur_radius $output_image
更新:
我已经弄清楚了语法并将其作为答案发布。
【问题讨论】:
-
如果它们允许您在您的用户帐户上执行 perl 或 python 或只是基本的二进制文件,您可以从 php 调用它们。
-
他们根本不允许我运行
exec。这就是为什么我想使用 ImageMagick PHP 模块来完成这一切。
标签: php imagemagick imagick imagemagick-convert