@tomoto-sauce, I simulated what share_image_data might be doing and converted the PIL to an ui.Image (UIImage) before saving (#3, below).
The results... The file sizes of #1 and #3 are the same, and all are PNGs, but in the case of my image, their size was almost 16 MB while the plain byte dump in #2 was about 11 MB. This sounds like the reverse of what you found.
pil = photos.get_assets()[-1].get_image()
with io.BytesIO() as tmp:
img_data = tmp.getvalue()
with open('experiment2.png', mode='wb') as fp:
img = ui.Image.from_data(img_data)
with open('experiment3.png', mode='wb') as fp:
Hello! I had this problem. What you need to do is add this to the top of your code:import ssl ssl.match_hostname = lambda cert, hostname: True and for the other error, just close and open the app. Hope it works for you!
Thanks, Mikael. You are correct in noticing I've been following some online courses, as well as reading some books, and have encountered differences in how Python runs on Pythonista.
The tutorials I have been following do use 3.6, mainly, and my goal is to learn python rather than run anything on iOS. I got Pythonista as a convenient way to practice coding rather than because it was related to iOS. Just as a way to tinker with code wherever I am.