How to use whatsapp-media-date-to-exif tool to parse image date
Hi there
I see this discussion about Whatsapp images having incorrect/missing date info: https://github.com/immich-app/immich/discussions/9116. In it, someone posted a script to automatically parse the date from the file name: https://github.com/icecore2/whatsapp-media-date-to-exif
My question is, on which version of the image should I run this script? Should I run it on the original images on my phone - how would I do that? Should I run it on the
${UPLOAD_LOCATION}/library
folder recursively?13 Replies
:wave: Hey @SkepticMystic,
Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker compose ps
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
Checklist
1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: I have read applicable release notes.
3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
4. :ballot_box_with_check: I have reviewed Github for known issues.
5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
7. :ballot_box_with_check: I have tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.You'd have to ask the author of the script, we don't know much about it here
But in general, you shouldn't mess with the files in UPLOAD_LOCATION
Alright, thank you
This thread has been closed. To re-open, use the button below.
Hi, I wrote the script. Just updated it with refactoring code and readme.
Thank you! š
I'll check this out later today/this week
Thank you for this script! It seems to work find for images and I can see the exif data in the result, but the script itself gave the below error for every file and also Immich is not picking up the metadata...
2024-08-31 17:12:21,113 - INFO - Parsed date and time from filename: 2018:12:17 00:00:00
2024-08-31 17:12:21,113 - INFO - New exif data: {'Exif': {36867: b'2018:12:17 00:00:00 00:00:00', 36868: b'2018:12:17 00:00:00 00:00:00'}}
2024-08-31 17:12:21,121 - INFO - './processed/IMG-20181217-WA0010_1.jpg' saved successfully
ā¹ An error occurred: New file doesn't have exif data.
Videos seem to be ignored. Any Idea how to fix it?
@icecore Any idea?Looks like just a log line that only mentioned that the file you processed, has no exif data. Not actual error. I'll look into it a bit later.
I looked at the code and it seems it is caused by a validation the is extracting the exif data after they were written to the file, which should never fail unless something went really wrong... but then the fact that immich is also not recognizing the exif data makes me think that really something is not 100% correct, but on a pic viewer in linux i can see the correct exif data so I'm wondering if there is some kind of encoding / formatting issue where that viewer is more tolerant than the lib you and immich is using to read out the data.
If I understand correctly it will only work for Android?
For future reference, this works well using exiftool.
and here are the install instructions for exiftool:
https://exiftool.org/install.html#Unix
Is it possible to run this on my existing library?
You will probably have to re scan