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

Files with no or other suffix are false negatives #24

Closed
FelixHaller opened this issue Sep 20, 2016 · 6 comments
Closed

Files with no or other suffix are false negatives #24

FelixHaller opened this issue Sep 20, 2016 · 6 comments

Comments

@FelixHaller
Copy link

FelixHaller commented Sep 20, 2016

When performing piexif.load()on a valid JPEG-File named testpic.docx or testpic I get a ValueError saying

Given file is neither JPEG nor TIFF

It's a lie!

Piexif should not consider the suffix to check if the file is valid. I personally use the imghdr python module to check if a file is valid and would appreciate a check=False parameter for piexif.load() to skip unnecessary checks.

Thanks in advance
Felix

@hMatoba
Copy link
Owner

hMatoba commented Sep 20, 2016

No file? No code?

@hMatoba
Copy link
Owner

hMatoba commented Sep 21, 2016

Piexif checks SOI.

@FelixHaller
Copy link
Author

You can use any jpg file. I attached one anyway. I think the check for SOI doesn't work, because the attached image starts with FF D8 and is reported as no JPEG.
Android.Statue.Garden.jpg.docx

@FelixHaller
Copy link
Author

for code see #25

@hMatoba
Copy link
Owner

hMatoba commented Sep 21, 2016

Thank you. But I want to looking for a way not to add argument. Give me a while.

@hMatoba
Copy link
Owner

hMatoba commented Sep 28, 2016

Done.

@hMatoba hMatoba closed this as completed Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants