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

Added missing HEIC box names and handling of a TIFF header inside HEIC #173

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

alketola
Copy link

Exifread exceptioned (crashed) when encountering undetected HEIC tags in .heif files produced by my HMD Nokia 8.3 5G mobile phone camera. Digging in to hex, I also found out that in some files, the metadata is missing 'Exif' before TIFF header near the end of file.

My initial solution is to:

  • Add dummy handling for encountered HEIC box names (which are also part of standard); in heic.py , those _parse functions
  • If EXIF data is pointed to a location where TIFF header offset is 0, accept that, and check if the TIFF header just sits there
  • Add to exifread/init.py _find_heic_tiff
  • Start with minimal changes

The good it that the my .heif files that used to crash don't crash exifread any more.
The bad it that at the moment looks like it still extracts less metadata from heic files than jpg files.

I entered this, because I have a project - fotofiler - of making a Python app that copies and sorts files according to metadata, and I'm using exifread there.

@alketola
Copy link
Author

alketola commented Jan 24, 2023

Tests did not pass I see, but the errors smells like it's about how the testing sets up it's virtual envionment.
( "Run actions/setup-python@v2
Version 3.5 was not found in the local cache" does not look too much a error of mine. The error seems to appear for a few previous pull requests too.

But of course, I'm always open to work on my code, should there be any concerns. :-)

@ianare
Copy link
Owner

ianare commented May 2, 2023

Thanks for the PR!

Sorry for the late reply (life happens...)

I've rebased origin develop and fixed some conflicts.

I also made some changes/fixes to the PR, mainly for linting issues.

Can you:

  • make sure I didn't break anything ;-)
  • send me a sample heic file that I can add to the public samples repository?

Thank you.

@alketola
Copy link
Author

alketola commented May 10, 2023 via email

@alketola
Copy link
Author

alketola commented May 10, 2023 via email

@ianare
Copy link
Owner

ianare commented May 13, 2023

Hey, I've done all the rebase stuff, no need to do that on your end anymore.

I've also merged your PR in the samples project but it's failing tests now on this PR.

You can see the test results whenever you push to this branch.

@ianare
Copy link
Owner

ianare commented May 13, 2023

Looks like it's the non HDR image that's not working: HMD_Nokia_8.3_5G.heif.

The HDR image is working, strange...

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

Successfully merging this pull request may close these issues.

2 participants