Added missing HEIC box names and handling of a TIFF header inside HEIC
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.
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. :-)
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.
Hello,
Sorry, it's been a week before getting back to you. Thank you for accepting my contributions.
For your requests:
- You asked me to rebase? Is it still needed? Sorry it's not too clear to me what exactly to do, but as always, I'll find out... but give me a hint where to look, in order not to waste time ;-)
- I'll check that everything works with your latest, but it may take some time
- I have a fork of exif-samples, with some HEIC files. I've put in a pull request, #10. If you wish, I can of course email the files too, or whatever.
Thanks to you, no problem, great to meet someone who values my contributions. :-)
ke 3. toukok. 2023 klo 1.47 ianaré sévi @.***) kirjoitti:
Thanks for the PR!
I made some changes/fixes to the PR.
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.
— Reply to this email directly, view it on GitHub https://github.com/ianare/exif-py/pull/173#issuecomment-1532287126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3SM72XSJN2JBBWT33RYR3XEGMJPANCNFSM6AAAAAAUE5UM3Q . You are receiving this because you authored the thread.Message ID: @.***>
I quickly tried my app (https://github.com/alketola/fotofiler) with requirement exifread @ @.*** ... and it seemed to work. I'll let you know about further results later, at least if there are any issues.
Cheers, Antti
to 11. toukok. 2023 klo 0.24 Antti Ketola @.***) kirjoitti:
Hello,
Sorry, it's been a week before getting back to you. Thank you for accepting my contributions.
For your requests:
- You asked me to rebase? Is it still needed? Sorry it's not too clear to me what exactly to do, but as always, I'll find out... but give me a hint where to look, in order not to waste time ;-)
- I'll check that everything works with your latest, but it may take some time
- I have a fork of exif-samples, with some HEIC files. I've put in a pull request, #10. If you wish, I can of course email the files too, or whatever.
Thanks to you, no problem, great to meet someone who values my contributions. :-)
ke 3. toukok. 2023 klo 1.47 ianaré sévi @.***) kirjoitti:
Thanks for the PR!
I made some changes/fixes to the PR.
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.
— Reply to this email directly, view it on GitHub https://github.com/ianare/exif-py/pull/173#issuecomment-1532287126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3SM72XSJN2JBBWT33RYR3XEGMJPANCNFSM6AAAAAAUE5UM3Q . You are receiving this because you authored the thread.Message ID: @.***>
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.
Looks like it's the non HDR image that's not working: HMD_Nokia_8.3_5G.heif.
The HDR image is working, strange...