Imagick (Imagemagick on PHP): serve a file without saving to disk first?

限于喜欢 提交于 2019-12-06 11:43:43

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;

I admit to never having used Imagick, but just looking at the examples, echoing the image should work just fine:

header('Content-type: image/jpeg');

$image = new Imagick('image.jpg');

echo $image;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!