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

PIL无法识别特定JPG文件的问题求助

PIL无法识别特定JPG文件的问题求助

大家好,我遇到了一个挺奇怪的问题:PIL能正常处理其他JPG格式的图片,但偏偏这张特定的JPG就是识别不了,我实在摸不着头脑,想请教下各位,问题可能出在哪,又该怎么解决呢?

我的代码如下:

import io
from aiohttp import ClientSession
from PIL import Image

session = ClientSession

async with session.get(f'https://rocket-league.com/content/media/itemshopPreviewDetailed/2024-12-12.jpg') as r:
    if r.status == 200:
        try:
            img = Image.open(io.BytesIO(await r.read()))
        except Exception as e:
            logging.warning(e)

运行后出现的错误提示是:
WARNING: cannot identify image file <_io.BytesIO object at 0x7f216a624810>

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.14 18:02:57