Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When try to get an image's exif, get error: SyntaxError: not a TIFF file (header b'' not valid) #4852

Closed
Julymycin opened this issue Aug 11, 2020 · 5 comments
Labels

Comments

@Julymycin
Copy link

Julymycin commented Aug 11, 2020

What did you do?

image = Image.open(image_file_path)
image.getexif()

What did you expect to happen?

to get the image's exif info
this error occurs for a few images, such as
2705

What actually happened?

SyntaxError: not a TIFF file (header b'' not valid)

What are your OS, Python and Pillow versions?

  • OS: Ubuntu 18.04LTS
  • Python: 3.7.7
  • Pillow: 7.2.0
@radarhere
Copy link
Member

Hi. How was this image created?

If I open the image and print im.info["exif"] the output is b'Exif\x00\x00'.

If I inspect the image with exiftool, part of the output is

Warning                         : Malformed APP1 EXIF segment

So can you demonstrate in any way that the image isn't malformed, or that there is EXIF data to be found?

@radarhere radarhere added the Exif label Aug 14, 2020
@Julymycin
Copy link
Author

Sorry for late reply. And I don't know clearly about these images, because they are contained in a dataset, named MHP:Multi-Human Parsing. This error occurs when I tried to load them in detectron2, detectron2 issue #1885. Thanks for your reply.

@radarhere radarhere changed the title when try to get an image's exif, get error: SyntaxError: not a TIFF file (header b'' not valid) When try to get an image's exif, get error: SyntaxError: not a TIFF file (header b'' not valid) Aug 31, 2020
@radarhere
Copy link
Member

Could you link to the image in the detectron2 repository, so that we can understand which image in there you've attached?

@radarhere
Copy link
Member

Closing, as there's no reason to think that the image isn't malformed.

@radarhere
Copy link
Member

radarhere commented Mar 11, 2022

This has re-appeared as #6123, so I've created #6124 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants