Hi,
I'd like to kindly ask for a few lines of sample code. I want to achieve this:
I have a custom ui.View where I draw things to.
I want to save the contents of this view as a PNG to my own, new album inside the device's Photos library.
The next time the user wants to save an image it should go into the – now existing – album.
So I assume it goes like this:
- Check if the album "my album" exists
- If it does not exist, create it (photos.create_album())
- Create the PNG image somehow from the ui.View contents (found this, works, writes a file local to Pythonista's sandboxed file system)
- Save this file into the album "my album" using AssetCollection.add_assets() somehow
Questions:
* Do I need to create this temporary PNG file?
* How do I check if an album exists? get_albums() only gives all albums. 😒
* How, exactly, do I add an image into "my album"?
Being still a Python starter it would be great if someone could help!
Thanks a lot!
Stefan.