Whatsapp picture issues - BRU renaming

Bulk Rename Utility How-To's

Whatsapp picture issues - BRU renaming

Postby lilimo » Sat Feb 12, 2022 9:20 am

Hi there,

A few years back I had an issue transfering my pictures from my iphone to my android where all folder structure broke. After this I was never really able to access the pictures from whatsapp anymore. Instead they stayed in the gallery dated as the day i transffered them.

Currently every picture is store in a file like this in my android phone:

Internal storage/android/media/com.whatsapp/whatsapp/media/whatsapp/images/201301/media/"phone number of whatsapp contact"/ random folder number / random letter of alphabet.
Essentially I have each picture in a folder named A-Z, in a folder number 1-10, all under the phone number. This is also messed up my exif as when I transfered all the pictures went under date of transfer.

Now imagine this done from 201301 to 201905, thousands of folders with a picture or two within each one, as there were more than one whatapp conversations every month of each year to each phone number.

I've managed to do it manually where I can rename the picture to the name of the main folder "201301". But it would take a lot of time to do every folder change respective exifs to the parent folder name, zip and through them back into the phone.

Is there anyway to directly source the parent folder a few levels up, re-write the exif as the parent folder name?

From within BRU I am looking into the subfolders so all the pictures come out nicely once I have pointed BRU to the ...images folder.

Any advice would be really appreciated.

Thanks for your time.
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby Luuk » Sat Feb 12, 2022 9:14 pm

I would first experiment to see if the tranfer application really alters any $metadata, because most will not conduct like this.
To experiment, you can put a checkmark inside of the menu "Rename Options, ID3/ExifData/FileProperties, Extract Exif Data".
Then to right-click any jpeg and "Show EXIF info", so then looking to see if "exif:DateTimeOriginal" does have the correct date.
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Sat Feb 19, 2022 10:55 am

Hi Luuk, thanks for the reply.

So due to the previous complication I have, the exif dates are already all messed up. All the exif dates of all the folders are 1 single day.

So what I would like to be done here is when I rename the pictures, to have the parent folder's (2 level up) name, and also to use the folder's name to make the respective exif date.

Thanks!
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby Luuk » Sun Feb 20, 2022 4:29 am

I would still highly recommend getting the free exiftool.exe, to first verify this problem with the exif-dates.
I'm never heard of a transfer that does corrupt files by overwriting them, instead of just transferring them.
The reason is because it takes a much, much longer to overwrite a file, than it does to just move it.

The $FileSystemDates can change after a transfer, but this is just the file-system applying its system-dates.
The file's exif-data should never get altered, because overwriting during any transfer could be very dangerous.
I guess it could overwrite all of the files first, and then conduct a transfer? but Im really never heard of this before??

With the exiftool.exe, you can compare "folder-date" against "all exif-dates" with a command like...
Code: Select all
exiftool -r -sep "   " -api MissingTagValue="------(none)------ " -p "#[HEAD]Folder   DateTimeOriginal      Exif:CreateDate       Exif:ModifyDate       Filename" -p "${filepath; tr|\\|/|; s|.*/([^/]+)(/[^/]+){4}/[^/]+$|$1|}   $DateTimeOriginal   $CreateDate   $ModifyDate   $Filename"  "C:/YourFolderPath"
This presents to the screen like...
Code: Select all
Folder   DateTimeOriginal      Exif:CreateDate       Exif:ModifyDate       Filename
201301   1998:01:01 00:00:00   ------(none)------    ------(none)------    1998-file.jpg
201301   1999:04:21 00:00:00   ------(none)------    ------(none)------    1999-file.jpg
201401   1999:05:16 00:00:00   ------(none)------    ------(none)------    19990516-file.jpg
201401   2020:07:25 12:15:12   2020:07:25 12:15:12   2020:07:25 17:46:24   File1.jpg
201501   2018:09:02 11:44:23   2001:01:02 03:11:22   2020:12:25 07:44:59   IMG_3.jpg
201202   2020:07:11 12:15:12   2014:09:25 20:48:32   2020:07:25 17:46:24   Sony1.jpg
201202   2021:07:11 12:15:12   2021:07:25 12:15:12   2020:07:25 17:46:24   thumb.jpg

You could add >"C:\PathTo\Some-file.txt" onto this command, to send this comparison into a text-file for reading later.
It looks 5-folders up to present folder-names like in the sample, but if needing 2-folders up, change the "4" into "1".
But of course, if you already verified that these exif-dates are corrupt, then this comparison cannot help at all !!

====================================================================================================

whatsapp/images/201301/media/Phone#/10/A/UnknownNowName.jpg ===> whatsapp/images/201301/media/Phone#/10/A/UnknownNewName.jpg

Are these folder-names always to be correct?
Is their date-format "yyyymm" or "yyddmm"?
Since 201301 is not complete, does UnknownNowName have any of the time-values?
What should the new-names look like, other than 201301.jpg (unless 1-file per folder)?

The bru will never overwrite a file's exif-data, but this what the exiftool.exe was designed for.
But still must say what is the date-format and also, what to use for any of the missing time-values.
Most people just use 00:00:00, but others will increase them by 1-second per filename, if the names are in order.
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Mon Feb 28, 2022 3:20 pm

Thank you so much for following up on my question!

I think there was a bit of miscommunication from my part, apologies. The original file transfers did not happen through BRU. it was through a failed WhatsApp transfer post my iPhone dropping in the sea... I eventually found a hardware recovery company that recovered all the files contents in just folders. Maybe thats why the exif files were messed up. By then I couldn't afford another Iphone, so I switched to android. And only then did I realise that I would not be able to recover the whatsapp folder format given that it's different to an iPhone.

Please find below the results of exiftool: I only one into a directory so I could run this. Otherwise it never finishes scanning.

C:\Users\ricar>exiftool -r -sep " " -api MissingTagValue="------(none)------ " -p "#[HEAD]Folder DateTimeOriginal Exif:CreateDate Exif:ModifyDate Filename" -p "${filepath; tr|\\|/|; s|.*/([^/]+)(/[^/]+){4}/[^/]+$|$1|} $DateTimeOriginal $CreateDate $ModifyDate $Filename" "C:\Users\ricar\Desktop\test"
Folder DateTimeOriginal Exif:CreateDate Exif:ModifyDate Filename
201311 ------(none)------ ------(none)------ ------(none)------ 09ff42c0835a77242f3029e101b96fd8.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 15fa501f0406e2c333faa8b48e877057.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 4684478797c151b1dc7f1e49b8f6a2eb.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 47b1fc87d3ff3a6c969585bed6fe2a19.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 62a545cbd2adde18f08ae707d37ead89.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 62fe604ee5444e7cf940de7f4b2319e2.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 78e0a21e74886b95f4011ddc46193672.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 7fe813f9cab286a4f84c1511c2aa288e.jpg
201311 ------(none)------ ------(none)------ ------(none)------ 8da8d5164645638c429524bdaf511ef1.jpg
201311 ------(none)------ ------(none)------ ------(none)------ a06d910e968a396cbb16a9ed18e819a2.jpg

list goes on and finishes

1110 directories scanned
550 image files read

==================

Examples of paths in my computer. I've used xxx to block the number as they are real phone numbers. I have also taken the liberty to copy a few of the folder paths here for you to understand the structure.

C:\Users\ricar\Downloads\Whatsapp files\201510\Media\8xxxx33727-1382016236@g.us\8\e
C:\Users\ricar\Downloads\Whatsapp files\201710\Media\85xxxx727-1503974141@g.us\e\7
C:\Users\ricar\Downloads\Whatsapp files\201511\Media\85xxxx2022@s.whatsapp.net\d\1
C:\Users\ricar\Downloads\Whatsapp files\201511\Media\85xxxxx2022@s.whatsapp.net\8\2
C:\Users\ricar\Downloads\Whatsapp files\201710\Media\85xxx29594@s.whatsapp.net\a\1
C:\Users\ricar\Downloads\Whatsapp files\201803\Media\14xxxx58982@s.whatsapp.net\2\e

The list goes on. The file paths start from 201308 to 201905.

=====

The folders are always yyyymm. Regarding the file name they don't appear to have any time values except all of them are indexed to 201905, when the hardware company recovered my data.
Ideally, If I could name them yyyymm00x.jpg. (and there are very few pictures per folder). I am not too fussed about the new file name order as long as I can have the month and year, this way I can store it nicely on my laptop, and also my phone for viewing (so it orders properly on gallery by creation date)

So far I figure that if I can overwrite exif data with the folder name, then I could use BRU to rewrite the files based on the folder name too, and move them all to 1 folder only. One thing I haven't figured is how to do it so that when I am re-writting, for it to use a new set of 0000 for every folder name, otherwise by the time I ge to 201905, the picture name be something like 201905-9999999.jpg.

Thanks again for your help. Really appreciate it.
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby Luuk » Tue Mar 01, 2022 10:47 am

Its unfortunate, but Im afraid that 'something else' does decide to remove all of your exif-dates??
This because sea water would destroy file-data randomly, instead of being prejudice against the exif.
Of course now its not to matter, with the exif-dates missing? But you might still try something like...

Code: Select all
C:\Users\ricar\exiftool -m -r -ext jpg -Progress:"ExifTool %p%%" -if "$AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//" -p "${filepath;s/.*Whatsapp files.(.+)/$1/}"  "C:/Users/ricar/Downloads/Whatsapp files" >"C:\Users\ricar\desktop\exif-results.txt"
This to invent a text-file showing the path to any jpeg with... at least one exif-date AND a folder-name between 201308-201905.
The window title presents % for progress time.. If the text-file has no paths, then nothing below 201308-201905 has any exif-date.

One thing Im forgetting to ask... Should the phone-numbers be saved into the exif-data??
Once everything gets settled into just 1-folder, then it might be hard to remember them.
If they should be saved, should it be... "eveything before @" or just the whole folder-name?
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm

Re: Whatsapp picture issues - BRU renaming

Postby Luuk » Wed Mar 02, 2022 5:36 am

In case you like to experiment with the last command, you might can make it much faster by changing...
"C:/Users/ricar/Downloads/Whatsapp files" ====> "C:/Users/ricar/Downloads/Whatsapp files/201???"
This way, the exiftool will only have to test folder-names like 201??? for 201308-201905.
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Wed Mar 02, 2022 4:39 pm

Thanks for getting back to me.

I wasn't able to run:


C:\WINDOWS\system32>C:\Users\ricar\exiftool -m -r -ext jpg -Progress:"ExifTool %p%%" -if "$AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//" -p "${filepath;s/.*Whatsapp files.(.+)/$1/}" "C:/Users/ricar/Downloads/Whatsapp files" >"C:\Users\ricar\desktop\exif-results.txt"
'C:\Users\ricar\exiftool' is not recognized as an internal or external command,
operable program or batch file.

No need to save the phone numbers, I am just trying to match the creation date to the name of the parent folder (yyyymmxxx.jpg), with xxx being picture number. After this I think I will try to rename the pictures to the parent folder name through BRU.

C:\Users\ricar\Downloads\Whatsapp files\201803\Media\14xxxx58982@s.whatsapp.net\2\e

Thanks again
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Wed Mar 02, 2022 4:47 pm

Sorry I realised my exiftool was located in my windows folder within C:

This is what I am getting. the exif results text file is blank.

C:\WINDOWS\system32>exiftool -m -r -ext jpg -Progress:"ExifTool %p%%" -if "$AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//" -p "${filepath;s/.*Whatsapp files.(.+)/$1/}" "C:/Users/ricar/Downloads/Whatsapp files/201308" >"C:\Users\ricar\desktop\exif-results.txt"
71 directories scanned
24 files failed condition
0 image files read

C:\WINDOWS\system32>exiftool -m -r -ext jpg -Progress:"ExifTool %p%%" -if "$AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//" -p "${filepath;s/.*Whatsapp files.(.+)/$1/}" "C:/Users/ricar/Downloads/Whatsapp files/201309" >"C:\Users\ricar\desktop\exif-results.txt"
169 directories scanned
60 files failed condition
0 image files read
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby Luuk » Thu Mar 03, 2022 12:28 am

Since all of the files are failing the condition, it does mean that they do not have any of the 3 exif-dates.
This an exiftool command to rewrite the exifs from your folder-names, and also conduct the renames...
Code: Select all
C:\Users\ricar\exiftool -m -r -ext jpg -ext jpeg -overwrite_original -Progress:"ExifTool %p%%" -if "not $AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//"      -UserComment"<${filepath;s/.*\/([-\d]{7,})@.*/Phone:$1/ or undef $_}"      -AllDates"<${filepath;s/.*\/(\d{4})(\d{2})\/.*/$1:$2:01 00:00:00/}"      -Filename"<C:/Users/ricar/exif-finished/${filepath;s/.*\/(\d{6})\/.*/$1/}%-.3nc.%e"      "C:/Users/ricar/Downloads/Whatsapp files/201???"
This to only conduct jpegs with no exif-dates and they must settled somewhere below /Whatsapp files/201308-201905...
Since there is only yyyymm, without any dd or time-values, its just guessing 01 for the dd, and midnight for the times?
So all 3 $exif-dates are written like "yyyy:mm:01 00:00:00", but you can change this guessing in the command.

It does also write the exif $UserComment with "Phone:###-#######" using phone-numbers found inside of the folder-path.
Im putting extra spaces in the command, so it can be easier to remove this part, if its not to be desired or edited.
Also, this command wont care about how far up is the "yyyymm" folder, in case your file-structure might vary?

After writing the exifs, it does then rename and move the files like...
C:\Users\ricar\Downloads\Whatsapp files\201510\Media\Phone#\8\e\aaa.jpg ====> C:\Users\ricar\exif-finished\201510-001.jpg
C:\Users\ricar\Downloads\Whatsapp files\201510\Media\Phone#\7\f\bbb.jpg ====> C:\Users\ricar\exif-finished\201510-002.jpg
C:\Users\ricar\Downloads\Whatsapp files\201803\Media\Phone#\d\1\aaa.jpg ====> C:\Users\ricar\exif-finished\201803-001.jpg
C:\Users\ricar\Downloads\Whatsapp files\201803\Media\Phone#\8\2\bbb.jpg ====> C:\Users\ricar\exif-finished\201803-002.jpg
C:\Users\ricar\Downloads\Whatsapp files\201803\Media\Phone#\2\e\aaa.jpg ====> C:\Users\ricar\exif-finished\201803-003.jpg
.....


Please to remove or edit any parts you dont wish to conduct.. If you like to make a preview-file for the renames...
Code: Select all
C:\Users\ricar\exiftool -m -r -ext jpg -ext jpeg -overwrite_original -Progress:"ExifTool %p%%" -if "not $AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//"  -testname"<C:/Users/ricar/exif-finished/${filepath;s/.*\/(\d{6})\/.*/$1/}%-.3nc.%e"   "C:/Users/ricar/Downloads/Whatsapp files/201???" >C:\Users\ricar\Desktop\exif-test-names.txt
This to also let you experiment with changing the path for the finished-files, just remember changing it in the other command also!
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Tue Mar 15, 2022 5:03 pm

OH my god! You are a legend!!! after 3 years of looking for solutions online.. you have saved me!
I cannot believe this is solved!!
Thank you thank you.

I just have one small request if you don't mind... I JUST noticed that I have the same issues with my videos folders. They are structured in the same way
Could you help me with this? To also change the exif information and rename the files? Only issue is I have already converted the pictures, so perhaps the ending of the file could be a slightly different? Otherwise when I throw into DCIM folder in my android they might clash?
If this is complicated, I have also maintaned an original folder before conversion just in case. So I can just follow your instructions as to whatever is most convenient.

Please see my path for the videos...
C:\Users\ricar\Downloads\whatsapp videos\201308\Media\85xxxxxxx70@s.whatsapp.net\1\4
C:\Users\ricar\Downloads\whatsapp videos\201712\Media\85xxxxxxx27-1508132553@g.us\f\9

You get the idea...

Thank you again!!
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Wed Mar 16, 2022 3:57 pm

I've actually tried to alter your code but didnt get any luck

exiftool -m -r -ext 3gp -ext mp4 -overwrite_original -Progress:"ExifTool %p%%" -if "not $AllDates and $filepath=~/\/2013(0[89]|1[012])|201[4-8](0[1-9]|1[012])|20190[1-5]\//" -testname"<C:/Users/ricar/exif-finished/${filepath;s/.*\/(\d{6})\/.*/$1/}%-.3nc.%e" "C:/Users/ricar/Downloads/Whatsapp videos/201???" >C:\Users\ricar\Desktop\exif-test-names.txt

1112 directories scanned
274 files failed condition
0 image files read
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby lilimo » Mon Mar 28, 2022 4:55 pm

I wonder if you will see this message. Thanks!
lilimo
 
Posts: 12
Joined: Sat Feb 12, 2022 9:11 am

Re: Whatsapp picture issues - BRU renaming

Postby hery7 » Mon Mar 18, 2024 12:20 pm

Addressing WhatsApp picture issues and BRU renaming demonstrates a proactive approach to enhancing user experience. By resolving these issues, users can enjoy smoother interactions and better functionality within the app. This commitment to improvement reflects positively on the platform's dedication to customer satisfaction and quality service.
hery7
 
Posts: 1
Joined: Mon Mar 18, 2024 5:31 am


Return to How-To