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.
Crash when running image view code
-
import ui v = ui.View() img_view = ui.ImageView(frame=(0, 0, 94.75, 94.75)) img_view.load_from_url('http://img04.sogoucdn.com/app/a/200678/c05334d63dfad90470f64f2f3e0abd91.png') v.add_subview(img_view) v.present('fullscreen')
Hi, Pythonista 3.3 Crash when running this code a second time (normal for the first time).any ideas?Thanks!
-
@mieq I don't have a real crash but my Pythonista is locked.... No idea why
-
@mieq workaround
import ui import requests url = 'http://img04.sogoucdn.com/app/a/200678/c05334d63dfad90470f64f2f3e0abd91.png' c = requests.get(url).content v = ui.View() img_view = ui.ImageView(frame=(0, 0, 94.75, 94.75)) img_view.image = ui.Image.from_data(c) v.add_subview(img_view) v.present('fullscreen')
-
@cvp works perfectly, so much thanks for your quick help!
-
@mieq I suppose, but not sure, the problem comes from asynchronous dark side of load_from_url 😀
-
@cvp It does make sense.😆
-
This post is deleted!