Pythonista-Issues icon indicating copy to clipboard operation
Pythonista-Issues copied to clipboard

ui.ImageView.load_from_url still seems to have problems

Open Phuket2 opened this issue 9 years ago • 3 comments
trafficstars

This is a old subject from the forum. The post I come across is 2 years old. But it appears to be the same. @JonB 's work around in the post using ui.Delay still works. But would be good if it could work as described

Phuket2 avatar Nov 05 '16 11:11 Phuket2

Maybe this is a little over the top. I don't think So I will ask anyway.
But it would be great if you could provide a full local path in the method or another attr, that would write out the downloaded file. So in subsequent runs if you pass both the URL and the local file name, the load_from_url method would first try to see if the local file is present and load it if it is otherwise attempt to get it from the URL. I realise you can make a wrapper for this sort of functionality, but seems nice if it was available out of the box.

Phuket2 avatar Nov 05 '16 12:11 Phuket2

Still valid, 311014 freezes. Copy & pasted test case from the forum:

import ui

def freeze_me():    
    image_view = ui.ImageView()
    image_view.load_from_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==')
    image_view.present()
    image_view.wait_modal()
    
    image_view = ui.ImageView()
    image_view.load_from_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==')
    image_view.present()    
    
freeze_me()

zrzka avatar Oct 24 '17 10:10 zrzka

330025 still has this problem. Since I need to display a lot of pictures, those workarounds don't seem to work well for me.sad.

mieqq avatar Feb 28 '20 15:02 mieqq