omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Speed of loading images into webbrowser

    Pythonista
    3
    5
    3685
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DaveR133
      DaveR133 last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • C0deH4cker
        C0deH4cker last edited by

        Can you post the code?

        1 Reply Last reply Reply Quote 0
        • DaveR133
          DaveR133 last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • DaveR133
            DaveR133 last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • fiimage34
              fiimage34 last edited by

              i am familiar with <a href="http://www.rasteredge.com/how-to/vb-net-imaging/load-from-file/">vb image loading codes</a> if you want some, i can provide you the easiest and simple one.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors