Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
photos - get original (heic) file and its name
-
Is there a way how to obtain original (heic) file, i. e. the same binary content as downloaded to computer via e. g. Microsoft Photos or uploaded when using Dropbox / Nextcloud? Is there a way how to obtain the original ordinal filename e. g. IMG_0810.heic?
I am trying to use Pythonista to create a reconciliation script that identifies pictures not backed up to my home server. I am able to compare files either by content or by date, time & filename.
-
@MichalOprendek tested, it works for heic photos, but try
import photos from objc_util import * assets = photos.get_assets() asset = photos.pick_asset(assets) filename = str(ObjCInstance(asset).valueForKey_('filename')) data = asset.get_image_data().getvalue() # bytes with open(filename, mode='wb') as fil: fil.write(data)
-
Thanks! It worked.