-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iOS Live Photo support and another format for guess_extractor #224
base: master
Are you sure you want to change the base?
Add iOS Live Photo support and another format for guess_extractor #224
Conversation
@@ -43,6 +43,12 @@ final _commonDatetimePatterns = [ | |||
r'(?<date>(20|19|18)\d{2}_(01|02|03|04|05|06|07|08|09|10|11|12)_[0-3]\d_\d{2}_\d{2}_\d{2})'), | |||
'YYYY_MM_DD_hh_mm_ss', | |||
], | |||
// example: 20190620_184109.jpg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this format of photos when going through my old photos 20190620_184109.jpg
, it seems to be used by older cameras.
final fileNameWithoutExtension = p.basenameWithoutExtension(file.path); | ||
|
||
if (fileNameWithoutExtension.startsWith("IMG") && | ||
p.extension(file.path).toLowerCase() == ".mp4") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Photo from iPhone with Live Photo enabled when uploading to Google Photos will create three files:
IMG_1845.HEIC
IMG_1845.MP4
IMG_1845.HEIC.json
The .MP4
file always comes in a pair with the .HEIC
file when the live photo is enabled, however, there is no JSON file for the video. We can also use the JSON file for the image to set the date for the video. This will ensure that the image and the video are stored in the same directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that it doesn't always start with IMG, for example, one of mine is like this:
97E2514D-F5BB-4314-B099-9A5FAE5EEA22.JPG
97E2514D-F5BB-4314-B099-9A5FAE5EEA22.JPG.json
97E2514D-F5BB-4314-B099-9A5FAE5EEA22.MP4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too see other files. Perhaps instead try to probe whether the img file exists next to it by doing an exists
check on the "possibleFileExtensions".
"jpg", | ||
"JPEG", | ||
"jpeg" | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have come across a few situations when the original image in the live photo pair is saved as a .jpg
or .jpeg
, they seem to use both upper and lower case. I suspect this is either because the HEIC format is disabled or the photo with the live photo feature was sent over iMessage which converted the image into a .jpeg
format.
Sample directory of the files:
IMG_3984.jpeg
IMG_3984.MP4
IMG_3984.jpeg.json
and...
IMG_7334.JPG
IMG_7334.MP4
IMG_7334.JPG.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done adding comments, requesting for your review :) @TheLastGimbus
Nice! Tho i will need to think more about it, how we should handle it etc, so give me some time to merge it... |
So, for now, i'm leaving this waiting for further advancements in metioned discussion... But, for anyway that wants this NOW, here are nightlies :> https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/actions/runs/6280579316 |
Hey @TheLastGimbus @BobTheSoftwareDeveloper Thanks for putting this PR together, I just tested the nightly build and wow! What a difference! Using the latest version (v3.4.3)
And the summary output shows
Whereas, using the nightly build with this PR included:
Only 1 file failed 👍🏻 😃 |
We're leaving not even one! @dbrennand Could you try to find other files related to this one (og photo and json)? |
I can have a look, what am I looking for exactly in the JSON? |
You're just looking for the json, and it's filename 👍👍 I just want to figure out why gpth didn't find it - it does so by filenames purely |
@TheLastGimbus - I'm not sure why it failed... 🤔 So for this live photo, the three files are named:
{
"title": "moments_09_19_8_20_51 pm.JPG",
} |
can you please look into it? |
@zxsleebu I'm gonna be honest - right now, no. And I can't really point when, but like a month from now at least. If you need your takeout with this, use @BobTheSoftwareDeveloper fork - nightlies are still here: https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/actions/runs/6280579316 It will even help to test it if you used it. I just don't have the time right now to make 10000% sure it all works (and potentially add all cool features above) and list it on the official repo |
can you please re-build https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/actions/runs/6280579316 Edit: nvm I forked it and ran it myself. I can confirm I went from 3.5k "Can't get date on...." to only 40 - everything else worked fine. Thanks |
I have met the same problem. Latest release is on Sep 23, 2023. The rebuild has expired. Can we have a new release? |
@@ -125,6 +126,7 @@ void main(List<String> arguments) async { | |||
jsonExtractor, | |||
exifExtractor, | |||
if (args['guess-from-name']) guessExtractor, | |||
heicVideoExtractor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this extractor perhaps come before the guessExtractor
? If it exits quickly when conditions are not met, it should be safe.
Any chance of being able to add RAW file support? Seems like some .dng and .cr2 files I had weren't transferred over. Not the worst, since it seems like the EXIF data has been kept intact, but adds another step to the process. Edit: Seems like .cr2 files were transferred over fine. What caused me issues were ~3mb "CR2" files that were actually jpgs, but labeled CR2 thanks to Google Photos. Renaming the files as JPG brought back all of their EXIF data and I could organize accordingly. |
I will look at it when i will take care of this project some day 🌈 |
Unfortunately for me all the Live Photos (MP4'S) went into a folder named "date-unknown" Date-unknown folder has files such as:
|
First of all, great tool! It has made my process of organising the Google Photos export so much nicer for when I upload the backup to S3.
I have tested the changes locally and it was able to add the EXIF date data to the video files successfully.