[Python] PIL cannot identify specific JPG file

Discussão em 'Python' iniciado por Stack, Dezembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    It works with other JPGs but not this one specifically, I'm wondering what's wrong and how it could be improved.

    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)


    The error is: WARNING: cannot identify image file <_io.BytesIO object at 0x7f216a624810>.

    Continue reading...

Compartilhe esta Página