I used to do that manually, by looking at the “PDF” tab of the file’s properties and then modifying the file’s timestamp in my file manager.īut then I found that I could use Phil Harvey’s exiftool to do so.Įxiftool was designed to work with EXIF metadata in images, as the name suggests, but it can read (and sometimes write) metadata from other file formats as well, such as PDF, MP3, and others. So I occasionally update file timestamps based on that timestamp saved inside the file. With PDF files, though, I find that most of them have a modification timestamp in the file’s metadata itself (and those that don’t often have at least a creation timestamp). However, sometimes I do use the browser, or I get the file from a source which had not preserved the file’s timestamp itself. To that end, for example, I generally try to download files using a method that preserves the file’s timestamp (such as using GetRight or curl rather than my browser). It could use some love (parameterization, error-handling, etc), but I didn’t care too much,Īs I hopefully never have to use this again.I generally like to have my file timestamps represent the real date of last modification, rather than the time at which I acquired the file. Of these, about 1500 were missing dates, of which all but about 20 were fixed by my script. Long story short - my takeout had around 23k files, half of which are probably media, and the rest json. Which fixed the gifs, but I did not update my “reporting” logic to take this into account, since I had so few gifs missing dates, meaning I realized that gifs use a different tag than jpgs, I ended up modifying the step that updates the media files to write both the tags, Use exiftool to identify files that were fixed in the staging folder, and then move these into a Fixed folder.Īt this point, all the media files in the staging folder were missing dates.This is helpful for files that didn’t have a json file whose name was something like.Use exiftool to batch update all the files in the staging folder still missing dates based on their filenames.Use exiftool to batch update all the files in the staging folder using the dates in their corresponding json files.Exiftool has a way to alter the time by an offset, but it doesn’t take into account DST.This is important, because if we didn’t do this, the times would all be off in the files by 4 or 5 hours, depending on Daylight Savings. Modify the timestamp in the json files to be in my local timezone.And other oddities that are frustrating.Sometimes it would be (notice the e in jpeg).For instance, if your media file was named abcde.jpg, most of the time, the json would be.I say normalized, because because Google didn’t always create the json files with the same naming convention.Copy the corresponding json files into a staging area with a normalized name.Copy these media files into a staging area.Use exiftool to identify media files in my takout library that were missing dates.Write a powershell script that does the following:.Get acquainted with, which is a popular utility to read and write the exif data in media files.The following is what I intended on doing: If you are looking for a solution, you might want to check out both of these repos. My takeout data happened to have the new folder structure. Google changed the folder structure for their Takout data, which broke their scripts. One of them hadn’t been updated in a few months, and the other looked more active, but had a new outstanding open issue about how I initially searched for how to fix this problem, and found a couple of GitHub repos containing solutions. These json files have metadata about the media files, such as the created date. Produces not just the files you’ve uploaded to them, but corresponding json files for each file you’ve uploaded. Google claims that the dates aren’t modified in the files that you originally provide to them. You probably did something similar, and like me, you quickly realized that lots of your photos didn’t have the proper dates. That was reduced to 130 gigs after I realized that they exported my albums as duplicate photos. This produced just over 220 gigs of photos and videos, I recently exported all of my Google Photos data using their “Takeout” tool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |