0

我可以接受命令并让它回显确切的命令,然后在 shell 中运行它,它可以工作并生成图像。但是,当它通过 exec 运行时,它不起作用。

exec('convert ' . $from_path . ' -trim +repage -resize ' . ICON_SIZE . 'x' . ICON_SIZE . '> +repage -gravity center -background none -extent ' . ICON_SIZE . 'x' . ICON_SIZE . ' ' . $to_path);

echo 'convert ' . $from_path . ' -trim +repage -resize ' . ICON_SIZE . 'x' . ICON_SIZE . '> +repage -gravity center -background none -extent ' . ICON_SIZE . 'x' . ICON_SIZE . ' ' . $to_path;

我只是将 echo 复制并粘贴到 shell 中并生成图标。这不是我程序中唯一的执行程序,也不是我与 imagemagick 一起使用的唯一执行程序。任何你能在这个问题上闪耀的光芒都将不胜感激。

4

0 回答 0