Adding photos to Google Photos albums should be a straightforward process, enhancing your photo organization and sharing capabilities. For users leveraging command-line tools like rclone
to manage their media, the expectation is for efficient and accurate transfers. However, sometimes the outcome isn’t as expected, especially when attempting to add existing photos to albums. This article delves into a peculiar issue encountered when using rclone
to add photos to Google Photos albums, where instead of simply adding, the tool sometimes creates copies, leading to duplicated photos with inconsistencies.
This exploration is based on a real-world scenario faced by an rclone
user while trying to organize their Google Photos. By understanding the problem, we can shed light on the nuances of managing Google Photos via command-line tools and potentially find solutions or workarounds for a smoother photo management experience.
The Curious Case of Duplicated Photos in Google Photos Albums
The user’s primary goal was to add photos already present in their Google Photos library into specific albums using rclone
. The natural inclination was to use the move
command, as it seemed the closest operation to adding a photo to an album without removing it from the main library. However, the results were inconsistent and unexpected.
In many instances, instead of adding the original photo to the designated album, rclone
created a new copy of the photo within the album. This resulted in two versions of the same photo:
- Original Photo (Photo Library): Residing in the main photo library, outside of any album.
- Copied Photo (Album): A duplicate created inside the target album by
rclone
.
These copies weren’t mere duplicates; they exhibited notable differences from the originals, indicating a re-upload process rather than a simple addition. These differences included:
- Upload Source: Photos added directly (not copied) to the album correctly showed “Uploaded from iOS” in Google Photos details, reflecting their original upload method. Copied photos, however, were marked as “Uploaded from rclone,” indicating a new upload event.
- File Size and Quality: Original photos retained their original quality and larger file sizes (e.g., 3.6 MB), while the copied versions within albums showed reduced file sizes (e.g., 1.8 MB) and were described as “Backed up (1.8 MB) Original Quality.” This suggests potential re-encoding or compression during the copy process.
- Metadata Loss: Crucially, the copied photos lost GPS location data, a significant piece of metadata present in the original photos.
Google Photos showing original and copied photos with different details
This screenshot visually represents the issue. It displays three photos resulting from a Google Photos search. Expanding the details reveals:
- The first photo is the original, not added to the album, with a larger file size, GPS data, and “Uploaded from iOS” as the source.
- The second photo, a copy, resides within the album (album name visible at the top), shows “Uploaded from rclone,” lacks GPS coordinates, and has a smaller file size.
- The third photo, successfully added to the album without duplication, retains “Uploaded from iOS” and GPS data, indicating the desired behavior.
Inconsistent Behavior: Copying vs. Adding
The most perplexing aspect was the inconsistency. While most photos tested resulted in copies being created in albums, some photos were indeed added to albums correctly – without duplication or metadata loss. This suggests that rclone
‘s interaction with the Google Photos API might behave differently under certain conditions.
To illustrate this inconsistency, the user tested two specific photos:
- IMG_0759_Original.JPG: When using
rclone move
on this photo to add it to an album, it consistently resulted in a copy being created. - IMG_1650_Original.JPG: In contrast, using the same
rclone move
command on this photo successfully added it to the album without creating a copy. Repeated attempts yielded the same result, highlighting a genuine difference in behavior between these two files.
Examining the rclone Logs
To understand what’s happening under the hood, the user provided detailed logs from rclone
using the -vv
flag. Analyzing these logs for both scenarios (IMG_0759 and IMG_1650) offers valuable insights.
Log Snippet for IMG_0759_Original.JPG (Copy Created):
2024/02/07 18:09:25 DEBUG : IMG_0759_Original.JPG: Need to transfer - File not found at Destination
...
2024/02/07 18:09:29 INFO : IMG_0759_Original.JPG: Copied (new)
...
2024/02/07 18:09:29 ERROR : IMG_0759_Original.JPG: Couldn't delete: google photos API only implements removing files from albums
This log snippet indicates that rclone
determined a transfer was needed (“Need to transfer – File not found at Destination”), proceeded to copy the file (“Copied (new)”), and then encountered an error when attempting to delete the original (which is expected behavior with Google Photos API as it doesn’t allow deleting from the library via API). The key takeaway is that rclone
perceived the operation as a new copy to be transferred.
Log Snippet for IMG_1650_Original.JPG (Successfully Added):
2024/02/07 18:11:42 DEBUG : IMG_1650_Original.JPG: Sizes identical
2024/02/07 18:11:42 DEBUG : IMG_1650_Original.JPG: Unchanged skipping
...
2024/02/07 18:11:42 ERROR : IMG_1650_Original.JPG: Couldn't delete: google photos API only implements removing files from albums
In contrast, the log for IMG_1650 shows that rclone
identified the sizes as identical and skipped the transfer (“Unchanged skipping”). This suggests that rclone
recognized the photo already existed at the destination (album) and correctly linked it instead of re-uploading. However, the error message about deletion still appears, which is consistent with the API limitations.
Potential Reasons and Seeking Solutions
The core question remains: why does rclone
sometimes copy and sometimes correctly add photos to Google Photos albums? Several potential factors could be at play:
- Google Photos API Behavior: The Google Photos API might have specific nuances or limitations that dictate how photos are added to albums via third-party tools like
rclone
. There might be internal identifiers or conditions within the API that differentiate between “adding” an existing photo and “uploading” a new one to an album. - File Metadata or Attributes: Subtle differences in file metadata, file types, or internal Google Photos attributes between IMG_0759 and IMG_1650 could be influencing
rclone
‘s behavior. Live photos, as mentioned by the user, could potentially be handled differently by the API. - rclone Implementation Details: There might be specific logic within
rclone
‘s Google Photos backend that, under certain conditions, triggers a copy operation instead of an add operation. This could be related to howrclone
identifies existing photos in albums or how it interacts with the Google Photos API for album operations.
To effectively address this issue and find a consistent way to add photos to Google Photos albums using rclone
without creating copies, further investigation is needed. This could involve:
- Deeper API Analysis: Examining the Google Photos API documentation and potentially experimenting with API calls directly to understand the precise mechanisms for adding photos to albums.
- rclone Code Review: Analyzing the
rclone
source code related to Google Photos and album operations to identify the logic that governs the “move” command and how it interacts with the API. - Community Collaboration: Engaging with the
rclone
community and developers to share these findings and seek insights or potential solutions. Reporting this as a potential issue on therclone
GitHub repository could also be beneficial.
Conclusion
Adding photos to Google Photos albums using rclone
should ideally be a seamless process of linking existing photos, not creating duplicates. The inconsistent behavior observed, where some photos are copied while others are correctly added, highlights a potential challenge in managing Google Photos via command-line tools. Understanding the root cause, whether it lies within the Google Photos API, rclone
‘s implementation, or specific file attributes, is crucial for finding a reliable solution. Further investigation and community collaboration are essential steps towards achieving efficient and accurate photo management in Google Photos using rclone
.