garzj / google-photos-migrate

A tool to fix EXIF data and recover filenames from a Google Photos takeout, preserving albums within the directory structure.
https://npmjs.com/package/google-photos-migrate
MIT License
104 stars 11 forks source link

Infinitely creates "duplicates-*" directories. #36

Closed claabs closed 6 days ago

claabs commented 1 week ago

I'm running using the docker image on a takeout created today. On both full and flat mode, after processing about 4000 images, it starts creating millions of empty duplicates-<number> directories in the output directory until killed. Mine created about 5 million after a few minutes before I stopped it.

Haven't tested any other accounts, so not sure if it's due to just my takeout, or something else.

claabs commented 1 week ago

Nevermind, I'm an idiot. I thought I was pulling the image from a registry; forgot it was built locally. I was on an ancient version.

claabs commented 1 week ago

Actually, nevermind again. I'm seeing this issue even after building the latest Docker image.

claabs commented 1 week ago

I added some logging and it looks like the culprit is a file named .jpg with an accompanying .json.

garzj commented 1 week ago

Thanks for the debugging! The issue occured whenever the .json file reported an empty title. I added an option to rename empty filenames defaulting to _. Please let me know if this fixed it for you, so I can release a new version.

claabs commented 1 week ago

Yep, works for me now! Saw the log message:

Sanitized file: /takeout/Google Photos/Photos from 2013/.jpg (New filename: _)

Also, I created #37 as it was an issue I was experiencing when building the image. Figured you might want to fit that in before a release as well.

Thanks!