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
-
@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 ? -
@DavinE said:
Possible to select a Folder from my Albums
Do you want to say "select an Album?"
If yes, try
import photos albums = photos.get_albums() for album in albums: #print(album.title) if album.title == 'MyAlbum': photos.pick_asset(assets=album)
-
@DavinE Is that what you wanted?
-
@cvp Yes, this is Perfect xD
Thanks ^^p.s. Load complete Folders is not possible or ?
-
@DavinE said:
Folders
I have a problem when you use the word folder because Apple supports folders of albums...
-
@DavinE said:
Load complete Folders
Sorry, but I don't understand what you want: what is load, complete, folder s
-
@cvp
I mean in the Photos app you can create Folder's with Albums right ?
and my question is load or Display the Folder Albums.do you understand now what i mean ?
But it's not bad if not.
I can do that with just one album without any additional folders -
@DavinE I've never seen something mentioned folders in Pythonista photos module, perhaps too old.
But I guess it should be possible viaObjectiveC.
Personally, I don't know how to create a folder in Photos. -
@cvp, no It's okay i use your code with one Album and remove the Photos in it when i uploaded it
with
Asset.delete()
this is possible or ? -
@DavinE said:
with Asset.delete() this is possible or ?
It should be...after a confirmation. The best way to be sure is to try on a picked photo