[英]Imagick (Imagemagick on PHP): serve a file without saving to disk first?
I'm trying to use Imagemagick (actually PHP's Imagick ) to create and output (serve) an image without saving it to disk first. 我正在尝试使用Imagemagick(实际上是PHP的Imagick )来创建和输出(提供)图像,而不先将其保存到磁盘。
Currently I'm having to save the file and then use verot upload class to serve the image. 目前,我必须保存文件,然后使用verot上传类来提供图像。
(Apache 2 server, PHP5) (Apache 2服务器,PHP5)
Sure. 当然。 This should work for you:
这应该为您工作:
$image = new Imagick();
// Do your image creation stuff. Make sure to set $image->setImageFormat();
header('Content-Type: image/filetype'); // Change filetype
echo $image;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.