【问题标题】:Imagick not displaying to page with content headers setImagick 不显示到设置了内容标题的页面
【发布时间】:2020-10-23 12:23:16
【问题描述】:

我在设置标题时无法让getImagesBlob(); 显示到页面。

下面的代码在浏览器中返回一个 courrpt 图像符号

header('Content-type: image/jpeg');
$combined->setImageFormat('jpg');
echo $combined->getImagesBlob();

但是,如果我不设置内容类型并在图像标签中显示图像,则此方法可行

echo "<img src='data:image/jpg;base64,".base64_encode($combined->getImagesBlob())."' />";

【问题讨论】:

  • 无法重现。你能给我们一个示例图像吗?

标签: php imagick


【解决方案1】:

导致此错误的代码中有回显。删除额外的回声是解决方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-12
    • 2022-01-25
    • 2013-04-06
    • 2015-05-27
    相关资源
    最近更新 更多