Created
August 8, 2025 09:41
-
-
Save iUltimateLP/eca739f63942adfded4bf4e681f8b391 to your computer and use it in GitHub Desktop.
Sometimes, WhatsApp images get their metadata removed, and the file date might be wrong. This exiftool command line parses the date from the filename (e.g. "IMG-20171028-WA0004.jpg"), and applies it to the metadata.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exiftool -overwrite_original ^ | |
"-AllDates<${filename;m/IMG-(\d{4})(\d{2})(\d{2})/;$_=\"$1:$2:$3 12:00:00\"}" ^ | |
"-FileModifyDate<${filename;m/IMG-(\d{4})(\d{2})(\d{2})/;$_=\"$1:$2:$3 12:00:00\"}" ^ | |
"-FileCreateDate<${filename;m/IMG-(\d{4})(\d{2})(\d{2})/;$_=\"$1:$2:$3 12:00:00\"}" ^ | |
IMG-*.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment