-
Notifications
You must be signed in to change notification settings - Fork 573
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
[Latest Edits] Portrait photos or blurred backgrounds do not seem to be well preserved and downloaded. #249
Comments
If I get you right: You edited a picture on your Phone and icloudpd does download the original and not the changed picture. Is this your issue? By design Apple only saves the original image in iCloud. The changes are just "described" in a meta file and the client software (Photos-App) applies these changes when you open the image. Currently it is not possible to download the edited image as far as I know... |
Thank you. I use portrait mode to take a picture of my face, and at the same time I get a picture with a blurred background. In fact, if you click the Download button on icloud.com, you will download a photo face with a blurred background and portrait. But if you use icloudpd download, there will be no photos with blurred background and portrait processing. Since it is 11:30 in the evening on my side, the test cannot be performed. I found an example Forgive me for not being able to use English and use Google Translate to convey my thoughts. Because I think it would be better if iPhone photos and downloads have the same effect. However, the download does not have some filter effects, so I am puzzled. And I almost delete all photos. |
Hi @menkej, I did some quick checking, and it is possible to get edited photos from iCloud. The photos are downloadable as JPEGs and are in the asset record under the name from pyicloud_ipd import PyiCloudService
email = "[email protected]"
password = "password123"
api = PyiCloudService(email, password)
photos = api.photos.all
photos_iter = iter(photos)
photo_noportrait = next(photos_iter, None)
photo_portrait = next(photos_iter, None)
asset_record_field_noportrait = photo_noportrait._asset_record['fields'].keys()
asset_record_field_portrait = photo_portrait._asset_record['fields'].keys()
print(asset_record_field_portrait - asset_record_field_noportrait) which gives the output: It is clear from this that the attribute This difference is the same between a non-edited and an edited photo. Since iCloud treats portait mode as any other edit, I think this issue can be solved by simply adding an option to Implementing this would require changing some Here is a very manual and messy way to add the photo.has_edits = u"adjustmentType" in photo._asset_record['fields']
if photo.has_edits:
prefix = u"resJPEGFull"
f = photo._asset_record['fields']
filename = photo.filename
# Modifying filename and extension for edit
filetype_entry = f.get('%sFileType' % prefix)
if filetype_entry:
filetype = filetype_entry['value']
else:
filetype = u"public.jpeg"
extension = photo.ITEM_TYPE_EXTENSIONS[filetype]
filename = "%s.%s" % (filename.split('.')[0] + "E" , extension)
version = {'filename': filename}
width_entry = f.get('%sWidth' % prefix)
if width_entry:
version['width'] = width_entry['value']
else:
version['width'] = None
height_entry = f.get('%sHeight' % prefix)
if height_entry:
version['height'] = height_entry['value']
else:
version['height'] = None
size_entry = f.get('%sRes' % prefix)
if size_entry:
version['size'] = size_entry['value']['size']
version['url'] = size_entry['value']['downloadURL']
else:
version['size'] = None
version['url'] = None
type_entry = f.get('%sFileType' % prefix)
if type_entry:
version['type'] = type_entry['value']
else:
version['type'] = None
photo.versions #make sure photo._versions is populated
photo._versions['edited'] = version Note all the necessary work on the filename. Apparently, even though the field is called Sorry if I made any obvious mistakes! I'm not too familiar with the inner workings of |
Thanks for your analysis, @Sebolains ! Seems like there is a chance to get this done. I'm currently deep into trying to port icloudpd back to the original pyicloud (and changing pyicloud to make this possible), and I'm also not familiar with pyicloud at all... ;-) So I like to postpone diving into into your suggestion to afterwards. If you think you can bring this to icloudpd without changing pyicloud, feel free to submit a pull request and we can integrate it together! |
@Sebolains I find it very useful if we could add support for downloading the edited version of the photos as well - have you had any chance writting this up as a patch/make a pull request? |
I made a simple modification, the edited photo changed the origin download default to resJPEGFullRes https://github.com/BeginLjm/icloud_photos_downloader |
I just noticed this today and its super disappointing. I was well into assuming the copy of photos and videos downloaded from icloudpd are as good as a backup. At the very least you should put up all such limitations in clear text in the README |
Upstream picklepete/pyicloud#347 expands on @Sebolains approach, and should ensure that the edited versions of photos are downloaded instead of the originals. |
Hi all, base.py.diff.txt edit: I just saw the code from picklepete/pyicloud#347 and it is indeed more elegant and complete, though only available in pyicloud. I also noted as well that using the --set-exif-datetime is breaking the file_size comparison between the icloud file and the downloaded file. indeed, setting the exif date time is adding a few bytes to the file and thus the file is downloaded twice. Maybe worth a new bug ? |
1.19.0 can download adjusted files (edits, portraits etc) |
Summary
Hope to provide photos that retain the portrait elements, rather than original photos without processing.
Context
It is not consistent with the iPhone photo. I hope the iPhone photo is consistent with the download.
Portrait photos or blurred backgrounds do not seem to be well preserved and downloaded.
icloudpd downloaded the most original photos, not processed photos.
I tried two command codes, for example
--size (original|medium|thumb)
--live-photo-size (original|medium|thumb)
It seems to look exactly the same, the file size is the same (but I did not verify the MD5)
--force-size I don't know what command this is or how to operate.
See
iCloud.com Download Photo
Github iCloudpd - Download Photo
————
The text was updated successfully, but these errors were encountered: