So I'm just starting to learn the Photos module in Pythonista and am currently working on a little program that lets you choose a photo from your Camera Roll and upload it to imgur using the official ImgurPython module. Installed with StaSh in case anybody's wondering.
Here's a bit of what I've got...
from imgurpython import ImgurClient
client_id = 'my id'
client_secret = 'my secret'
client = ImgurClient(client_id, client_secret)
# ...
@ui.in_background
def upload(sender):
global img
ImgurClient.upload_from_path(image path goes here, config = None, anon = True)
@ui.in_background
def findimage(sender):
global img
img1 = photos.pick_asset(assets=None, title='', multi=False)
img2 = img1.get_ui_image()
img = img1.get_image()
v['imgview'].image = img2
The issue is in the upload function where we need to insert an image path, which is obviously tricky in Pythonista due to how iOS works. Anybody have ideas on some workarounds?
Sorry for using globals btw, I'm still learning :p