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.
Pythonista Upload Photos from Library
-
@cvp said:
@DavinE said:
the same way above ?
and how can i select them in Pythonista ?No no. Picked phoTos reads for you the photo file in memory (asset)
If you want to get all files of Files App, you will need to define an external open folder in the left browser of Pythonista.
okay and then Pythonista have access to this folder and can Upload it ?
do you know the path of this external folders ? -
@DavinE said:
do you know the path of this external folders ?
It depends on which folder?
Example, I have a Numbers folder in iCloud Drive, for the standard app. Path is
/private/var/mobile/Library/Mobile Documents/com~apple~Numbers/Documents/Myfile.numbers -
@DavinE said:
and then Pythonista have access to this folder and can Upload it ?
Yes if you define the wanted folder in your external folders
-
@cvp Works this also with an folder on iPhone not in iCloud ?
-
-
Example of path of an image of a private folder on my iPad
/private/var/mobile/Containers/Shared/AppGroup/EF3F9065-AD98-4DE3-B5DB-21170E88B77F/File Provider Storage/Photos vacances/20200728_140243.jpg
And copy works
-
@cvp
i Tried it too and works for me ;)
but my number is different on my iPhone i need to look how i get my Paths on local because i got 6 different Devices xD -
-
@cvp,
i Have a Problem with the present of the view...
i get this error:in uploadCustomerFiles_FTP__ACTION_Button iv.present('fullscreen') ValueError: View is already being presented or animation is in progress
can i use in my main view another view ?
The first Images Present works but the second one creates the error
-
@DavinE said:
can i use in my main view another view ?
You have to close the presented view before you present another one
-
@DavinE try so
iv = ui.ImageView() iv.present('fullscreen') assets = photos.pick_asset(title='Pick some assets', multi=True) for asset in assets: pil = asset.get_image(original=False) iv.image = asset.get_ui_image() #pil.save(os.path.join(os.path.dirname(sys.argv[0]), filename), quality=95) temp = io.BytesIO() pil.save(temp, format='JPEG', quality=95) temp.seek(0) filename = '%s%s' % (console.input_alert('Rename File', 'Message: rename File', hide_cancel_button=False), '.PNG') ftp.storbinary('STOR Films/Divers/'+filename , temp) iv.close()
-
@cvp said:
@DavinE try so
iv = ui.ImageView() iv.present('fullscreen') assets = photos.pick_asset(title='Pick some assets', multi=True) for asset in assets: pil = asset.get_image(original=False) iv.image = asset.get_ui_image() #pil.save(os.path.join(os.path.dirname(sys.argv[0]), filename), quality=95) temp = io.BytesIO() pil.save(temp, format='JPEG', quality=95) temp.seek(0) filename = '%s%s' % (console.input_alert('Rename File', 'Message: rename File', hide_cancel_button=False), '.PNG') ftp.storbinary('STOR Films/Divers/'+filename , temp) iv.close()
lol.. This works ^^
i used it like this:assets = photos.pick_asset(title='Pick some assets', multi=True) for asset in assets: pil = asset.get_image(original=False) iv = ui.ImageView() iv.image = asset.get_ui_image() iv.present('fullscreen') #pil.save(os.path.join(os.path.dirname(sys.argv[0]), filename), quality=95) temp = io.BytesIO() pil.save(temp, format='JPEG', quality=95) temp.seek(0) filename = '%s%s' % (console.input_alert('Rename File', 'Message: rename File', hide_cancel_button=False), '.PNG') ftp.storbinary('STOR Films/Divers/'+filename , temp) iv.close()
but thus i get the error ^^
Thanks again @cvp -
@DavinE said:
lol.. This works
Only one view, used for all photos, one after one.
Your (my previous) script created a new view for each photo and we present the next one before the previous one is fully closed, known problem.
-
-
-
@cvp said:
@DavinE If you want a file picker, you can use this one and passing your "On my iDevice" folder, like
file = file_picker_dialog('On your iDevice', root_dir='/private/var/mobile/Containers/Shared/AppGroup/EF3F9065-AD98-4DE3-B5DB-21170E88B77F/File Provider Storage')
i take a look on this ;) ty
-
@cvp,
I have a Problem....
my Code:assets = photos.pick_asset(title='Bitte wähle deine Bilder aus', multi=True) iv = ui.ImageView() iv.present('fullscreen') for asset in assets: pil = asset.get_image(original=False) iv.image = asset.get_ui_image() temp = io.BytesIO() pil.save(temp, format='JPEG', quality=95) temp.seek(0) filename = '%s%s' % (console.input_alert('Bennung des Bildes', 'Gib deinem Bild einen Namen', hide_cancel_button=False), '.JPEG') self.connection_FTP.storbinary('STOR '+f'{self.subDirCustomer_Bilder}/{filename}', temp, blocksize=32768) iv.close()
doesn't work anymore... but i don't get an error or something...
but i don't know whydid you maybe see anything ?
I tried this code and it works but now... nothing.... -
my mistake...
my Drive Client did not work :(
-
@DavinE ok, thus, good luck
-
@cvp Hey,
I have a Question about the photos Picker..
Is it Possible to select a Folder from my Albums... and not all of them ?
do you know something about that ?