我有下面的代码:PHP ImageMagick的输出图像字符串到stdout而不是保存到文件
$animation = 'animation.gif';
$watermark = 'watermark.jpg';
$watermarked_animation = 'watermarked.gif';
$cmd = "$animation -extent 400x255 -coalesce -gravity southwest -geometry +0+0 null: $watermark -layers composite -layers optimize";
exec("convert $cmd $watermarked_animation", $output);
print_r($output);
我要输出的图像串stdout,而不是将其保存到文件?
我该如何做到这一点?
预先感谢您!
此外,您正在主动提供带有输出文件('$ watermarked_animation')的转换。尝试用'-'替换它以写入标准输出。 – ccKep
stdout在这种情况下意味着什么 - 我对Linux一无所知。你想在浏览器中显示gif而不保存它吗? – Bonzo
@ccKep:我不想使用ImageMagick的php类。我只需要这一个命令。我也想避免第三方的PHP脚本。 – Marian