Missing EXIF tags could make your android gallery look bad

I recently helped migration to an new android phone. One part of the process was to store old (WhatsApp) stored images on internal storage towards the external storage SD Card.

Installing the new phone revealed an unexpected fall-out of having all the old pictures being sorted as being taken today.

Close inspection revieved Android Media Store uses the EXIF CreateDate to store the moment the picture was taken, missing the tag, it will use the file modification date as backup. How-ever this modification date of course was reset, because the file was copied from internal storage, without preserving the file modification dates.

The first attempt of fixing the issue was by turning off the phone, removing the SD card and fix the modification time of every file, based on the date identifier found in the file e.g. $ touch -a -m -t 201906230000 IMG-20190623-WA001.jpg.

After an re-insert of SD and turning the phone back on, it was not fixing anything. Basically the re-indexing needed to be forced. This is best done by removing all data from the 'Media Storage' System App. Go to Settings -> Apps -> "3 dots button" -> "Show System Apps" -> "Media Storage" -> Storage -> "Clear Data" -> OK. And next reboot the phone and open the images overview on the SD card using Settings -> "Device Care" -> Storage -> "SD Card" -> "Images". Depending on the amount of pictures this could take a while before your device is responsive again.

So finally all pictures and videos are indexed again and the Gallery shows pictures and videos in good order again. All happy right? ... but wait what about Facebook App ... personally I would nuke it and never look back, how-ever some people do not care about being 'the product' and will happily 'pay' for the service by providing lots of personal data. Having this said, I like a good engineering puzzle, so let's get started.

Facebook App (and maybe others) are still showing pictures garbled, which is annoying when for example wanting to upload older pictures, since you have to scroll down a long while before getting to the good stuff again. Apparently facebook does not rely on the metadata generated by the "MediaStore" and generates it's own, how-ever it blindly ignores the file modified date if EXIF data is missing and simply tags the picture as being taken the moment it is indexed. So how-to fix it?

First and foremost we need help, by some very powerful software EXIFTool, this will help us create the required EXIF tags based on the date string found in the filename. So turn off the phone again and plug the SD Card into a computer ones more.

We are going to use this magic:

$ exiftool \  
    "-datetimeoriginal-=" \
    '-datetimeoriginal<${filename;$_=substr($_,4,8)} 00:00' \
    "-createdate-=" \
    '-createdate<${filename;$_=substr($_,4,8)} 00:00' \
    '-filemodifydate<${filename;$_=substr($_,4,8)} 00:00' IMG-*WA*

To explain a little:

  • Do not update DateTimeOriginal EXIF tag if already exists:

"-datetimeoriginal-="

  • Base the DateTimeOriginal EXIF tag on the filename, by selecting the 5th until 12th character in the filename and expanding this with time midnight (00:00). This special rule is required to ensure file named like IMG-20190405-WA-1290.jpg could be parsed without issues, normal syntax is causing 90 to be specified as minutes which causes errors on importing.

'-datetimeoriginal<${filename;$_=substr($_,4,8)} 00:00'

  • Same applies for EXIF CreateDate:
       "-createdate-=" \
        '-createdate<${filename;$_=substr($_,4,8)} 00:00' \
    
  • our previous $ touch equivalent is a nice-to-have yet not required:

'-filemodifydate<${filename;$_=substr($_,4,8)} 00:00' IMG-*WA*

Now, put your SD card back in the phone and turn it back on. Clear your facebook data "Settings -> Apps -> Facebook -> "Clear Data" -> "Ok' and restart your Facebook Apps and wait a long time again. After your phone (literally) cools down it's time to enjoy the result.

Comments

1. anonymous -- 5 months ago

Thank you for guiding the people about the storage of the data and images in such a beautiful way and now I can get top resume services to manage the task. For android users, data recovery is one of the most important things to do. But this post has made it easier for them to recover the data.

2. Mike Rooney -- 4 months ago

I really enjoyed this site. This is such a Great resource that you are providing and you give it away for free. It gives in depth information. Thanks for this valuable information. <a href="https://www.celebsmoviejackets.com/the-boys-frenchie-field-jacket">The Boys M-65 Field Jacket</a>

3. anonymous -- 4 months ago

You can open any image and choose which fields to delete individually or just delete all the exif data at once & then click save. Very easy to use and effective. I've tried 3 other exif erasers and exif editors and they really stunk. I finally found what I was looking for with this app. Great for privacy concerns. essay writing service

4. Alina -- 4 months ago

Hi, I am Alina. Now, I would like to say, I recently assisted immigration to a new android phone. One part of the procedure was to store old Facebook and WhatsApp stored images on interior storage towards the outside storage SD Card. so, we offer |Law dissertation topics for free topics and ideas. The idea of a dissertation is something that pretty much haunt students since the day they begin their degree.

5. DissertationUK -- 4 months ago

Searching for online dissertation help UK? A firm named, Dissertation Writing Ace provides you all guidance in order to finish your university work in an effective manner. We have a team of Ph.D. experience writer that you don’t have to worry about your grades. Your satisfaction is our priority! So feel free to contact us at any time. As we are available 24/7!

6. anonymous -- 3 months ago

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! www.jnii-usa-bharat.com

7. anonymous -- 3 months ago

I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details. www.jrcustombuilt.com

8. anonymous -- 3 months ago

If it's not too much trouble share more like that. www.keithraniereconversations.com

9. anonymous -- 3 months ago

I truly like you're composing style, incredible data, thankyou for posting. www.ladieshealthandfitnessusa.com

10. anonymous -- 3 months ago

I have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you... www.leonhard-styline-design.com

11. anonymous -- 3 months ago

Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing. www.letsdancetoo.com

12. anonymous -- 3 months ago

This website is remarkable information and facts it's really excellent www.lutzperfauto.net

13. anonymous -- 3 months ago

This is a fantastic website , thanks for sharing. www.mainstreet-resources.com

14. anonymous -- 3 months ago

I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. www.majesticpalmtrees.com

15. anonymous -- 3 months ago

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! www.maryemtollar.com

16. anonymous -- 3 months ago

This is a fantastic website , thanks for sharing. www.mikeforceassoc.org

17. anonymous -- 3 months ago

I think about it is most required for making more on this get engaged www.minimumwagerealitycheck.com

18. anonymous -- 3 months ago

A great website with interesting and unique material what else would you need. www.mmltec.org

19. anonymous -- 3 months ago

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! www.modelart-world.com

20. anonymous -- 3 months ago

I see the greatest contents on your blog and I extremely love reading them. www.motoramaassoc.com

21. anonymous -- 3 months ago

it's really cool blog. Linking is very useful thing.you have really helped Auto insurance near me

22. hannaswarn -- 3 months ago

You may have difficulty structuring your thoughts and organizing them into a cohesive review. For these same reasons, professors are so passionate about asking their students to write a book review. Here is the best service that can help you with your review https://top-papers.com/write-my-book-review/.

23. anonymous -- 2 months ago

I surely acquiring more difficulties from each surprisingly more little bit of it www.bonsaidiscworld.com

24. anonymous -- 2 months ago

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. www.all-business-books.com

25. anonymous -- 2 months ago

I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read !! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. www.southriverfiredepartment.org

26. anonymous -- 2 months ago

The writer is enthusiastic about purchasing wooden furniture on the web and his exploration about best wooden furniture has brought about the arrangement of this article. house painters

27. anonymous -- 2 months ago

I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you! www.wing-makers.com

28. anonymous -- 2 months ago

I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you! www.wing-makers.com

29. anonymous -- 2 months ago

It should be noted that whilst ordering papers for sale at paper writing service, you can get unkind attitude. In case you feel that the bureau is trying to cheat you, don't buy term paper from it. www.walkerpoolsinccalifornia.com

30. anonymous -- 2 months ago

I will really appreciate the writer's choice for choosing this excellent article appropriate to my matter.Here is deep description about the article matter which helped me more. www.katiedavisblog.com

31. anonymous -- 2 months ago

This is an awesome motivating article.I am practically satisfied with your great work.You put truly extremely supportive data. Keep it up. Continue blogging. Hoping to perusing your next post www.totalrecoiloutfit.com

32. anonymous -- 2 months ago

Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. www.marcreynoldssailmaker.com

33. anonymous -- 2 months ago

I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you! www.yestosavehomes.com

34. anonymous -- 2 months ago

It's late finding this act. At least, it's a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act. bullyvictimbystander.com

35. anonymous -- 2 months ago

Thanks for the best blog. it was very useful for me.keep sharing such ideas in the future as well. www.mass-homes.net

36. anonymous -- 2 months ago

Hi to everybody, here everyone is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily www.online-net-business.com

37. anonymous -- 2 months ago

My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more! www.huntingcinnamonridge.com

38. anonymous -- 2 months ago

Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. www.aspenvermont.com

39. anonymous -- 6 weeks ago

Hi there friends, its impressive article concerning educatio nand completely defined, keep it up all the time. No Time to Die Wardrobe

40. anonymous -- 5 weeks ago

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. 모바일릴게임

41. anonymous -- 4 weeks ago

I would like to thank you for the efforts you have made in writing this article. Explore a supernatural world and master the art of wizady in game https://www.sims4-cheats.com/ : realm of magic. Coming on

Add New Comment