Forum Archive

Crash when running image view code

mieq
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!

cvp

@mieq I don't have a real crash but my Pythonista is locked.... No idea why

cvp

@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')  
mieq

@cvp works perfectly, so much thanks for your quick help!

cvp

@mieq I suppose, but not sure, the problem comes from asynchronous dark side of load_from_url 😀

mieq

@cvp It does make sense.😆

arno

thank you so much it helps me well see https://sarkariresult.onl/ , https://pnrstatus.vip/ & https://19216811.cam/ it helps me too