Forum Archive

Speed of loading images into webbrowser

DaveR133

I wrote a script that downloads images (a sequence of weather maps) from the internet and displays them using Image.show. It works fine. But the images are not zoomable.

So I wrote an html module which takes a list of these maps (the paths to them) and displays them in the webbrowser module in a slideshow - which is zoomable. Each map is loaded by inserting its path in the form
file:///var/mobile........filename.png
using forward/backward buttons and a bit of javascript which changes the html.
All that works fine too.

BUT the maps take ages to load in the webbrowser - much slower than they all appear on the console with Image.show. Slower than loading an image from the internet! It's OK once they've been displayed once (ie they're cached I suppose) but it's painful waiting for them as I click through the slideshow.

Can anybody suggest why the browser is so slow doing this, and whether I can do anything to speed it up? It ought to be fast loading an image from memory. It might be the javascript - but there's not much of it.

C0deH4cker

Can you post the code?

DaveR133

You need several files to use this so I've put them all on gist together with a readme with instructions and a list of all the files.
https://gist.github.com/62556c9497c8238d8b78

(I'm new to gist - that's probably not the best way.)

All comments welcome.

DaveR133

I tried the idea I wrote in that readme - pre-emptively loading the next map, but hidden, to get it into the browser's cache. On a non-rigorous test it works well. The first load is slower but subsequently it's faster moving between maps. It also confirms it's not the javascript that's the problem.

I still wonder why it's so slow to display an image that's in the filestore?

fiimage34

i am familiar with vb image loading codes if you want some, i can provide you the easiest and simple one.