Google Takeout import doesn't use the "title" field from the metadata JSON field for the uploaded filename #4968
Replies: 2 comments 1 reply
-
I was looking at the code to see if I could fix this, and I'm a bit confused about For context, I'm looking at the code in . |
Beta Was this translation helpful? Give feedback.
-
As requested in the Contributing guidelines, please do not start with code changes unless the functionality changes have been has been agreed to. ps. I really appreciated you letting us know about that new Google Takeout suffixes yesterday 🙏, and so I'm only commenting to save you effort on PRs that are unlikely to be merged. |
Beta Was this translation helpful? Give feedback.
-
Description
When Ente uploads images from a Google Photos Takeout directory, it uses the image's filename as-is (i.e. the same filename that the image has in the Google Takeout zip file) as the filename of the image within Ente. However, Google Takeout often truncates the actual image filename (and does all kinds of other weird filename transformations) before storing it in the zip file. The original filename is always saved in the image's metadata JSON file under the
"title"
field. Ente should be using the value of this"title"
field during upload to preserve the original filename.For example, my Takeout zip file contains these 3 files:
The
00100lPORTRAIT_00100_BURST20190915164304772_CO.json
file contains:So when the
00100lPORTRAIT_00100_BURST20190915164304772_COV.jpg
file is uploaded to Ente, it should be saved as00100lPORTRAIT_00100_BURST20190915164304772_COVER.jpg
instead of00100lPORTRAIT_00100_BURST20190915164304772_COV.jpg
. (I'm less certain if the filename of the00100lPORTRAIT_00100_BURST20190915164304772_COV(1).jpg
file should be similarly adjusted or not, as I haven't fully understood the semantics of these(1)
files and why they sometimes have their own JSON files and sometimes they don't).The use case, aside from improving the fidelity of the upload, is that I have some photos that I uploaded from my computer to Google Photos a while ago. Now I want to import everything from Google Photos to Ente, but I also want to import some of these old photos from my computer in case not all of them ended up in Google Photos. I need the original filename to be preserved so that Ente realizes that the photo being uploaded from my computer is the same one as the photo that was imported from Google Photos.
Proposed solution
From a brief glance through the Ente source code, I think the required change is in
extractImageOrVideoMetadata()
insideweb/apps/photos/src/services/upload/upload-service.ts
. Specifically, to useparsedMetadataJSON.title
(which would have to be added as a new field) instead offileName
as the value ofmetadata.title
if theparsedMetadataJSON.title
field is set. I can put up a PR with the changes if you think this approach makes sense.Version
v1.7.8
What product are you using?
Ente Photos
What platform are you using?
Desktop - Linux
Beta Was this translation helpful? Give feedback.
All reactions