Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error opening jpeg file #7879

@bigcat88

Description

@bigcat88

Maybe it is something wrong on my setup, but never seen that Pillow had problems with jpeg files.
Unfortunately currently has no free time to dive and debug/fix it myself.

I will just create an issue, feel free to close it, if after test there will be no problem found.

What are your OS, Python and Pillow versions?

  • OS: macOS 14
  • Python: 3.11.6
  • Pillow: 10.2 / 10.3.0.dev0
from PIL import Image, ImageSequence

if __name__ == "__main__":
    i = Image.open("bad.jpeg")
    for b in ImageSequence.Iterator(i):
        print(b.getexif())  # SyntaxError: not a TIFF file (header b'http://n' not valid)
from PIL import Image

if __name__ == "__main__":
    i = Image.open("bad.jpeg")
    i.show() # OSError: image file is truncated (664585 bytes not processed)

Problematic file(removed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions