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.
Images not loading in ui.imageview()
-
Loading an image from the local library works fine. See code below.
import ui import Image sv = ui.ScrollView() sv.background_color = 'gray' iv = ui.ImageView() iv.image = ui.Image.named('Test_Bridge') sv.add_subview(iv) sv.present()
But when I add my own image from the camera roll it does not work. What needs to be done to load a custom image?
I open my photo album and copy the photo to clipboard using share menu. I then add the photo to Pythonista using the insert option. I can see it in the My Images category in Pythonista. It just wont load in for some reason.
import ui import Image sv = ui.ScrollView() sv.background_color = 'gray' iv = ui.ImageView() iv.image = ui.Image.named('_Image_1') #does not work #iv.image = ui.Image.named('_Image_1.PNG') does not work #iv.image = ui.Image.named('_Image_1.png') does not work #iv.image = ui.Image.named('_Image_1.JPG') does not work #iv.image = ui.Image.named('_Image_1.jpg') does not work sv.add_subview(iv) sv.present()
I am using Pythonista 1.5 on iOS9 - iPhone 6+
-
Use http://omz-software.com/pythonista/docs/ios/photos.html to access the camera roll.
-
I may not have spoken clearly. The goal here is to put a custom image in an imageview(). The camera roll is just a place where I am getting my images from to put into pythonista.
-
See
image_file.py
at https://github.com/cclauss/Ten-lines-or-less -
Thank you @ccc