You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Imagick处理PNG文件时抛出异常的问题求助

Imagick处理PNG文件时抛出异常的问题求助

大家好,我正在基于Imagick开发缩略图生成系统,目前JPG和WebP格式的图片都能正常生成缩略图,但处理PNG文件时总会抛出异常,错误信息如下:

"improper image header `/tmp/magick-fj49nThGt9uvW0CFbLJj7XGsqT7x30OC' @ error/png.c/ReadPNGImage/4107 => /var/www/html/Dullahan/thumbnail/Application/Generator/ImagickThumbnailGenerator.php => 89"

对应的调用栈信息:

[
    {
        "file": "/var/www/html/Dullahan/thumbnail/Application/Generator/ImagickThumbnailGenerator.php",
        "line": 89,
        "function": "readImageFile",
        "class": "Imagick",
        "type": "->"
    },
    {
        "file": "/var/www/html/Dullahan/thumbnail/Application/Generator/ImagickThumbnailGenerator.php",
        "line": 54,
        "function": "generateThumbnailFile",
        "class": "Dullahan\\Thumbnail\\Application\\Generator\\ImagickThumbnailGenerator",
        "type": "->"
    }
]

有没有大佬遇到过类似的问题?麻烦帮忙分析下可能的原因,比如是不是PNG文件本身的格式问题,还是Imagick的配置、版本存在什么坑?

备注:内容来源于stack exchange,提问作者Mortimer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 07:34:36