Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Large Images takes a long time to load #15

Open
SoerenBusse opened this issue Apr 3, 2016 · 4 comments
Open

Large Images takes a long time to load #15

SoerenBusse opened this issue Apr 3, 2016 · 4 comments

Comments

@SoerenBusse
Copy link

Hi,

I loaded a MD-File containing big images (6x1MB).
The loading progress is very slow, so the content isn't showing fast enough.

Is there a way to speed it up? e.g loading the images asynchron?

@falnatsheh
Copy link
Owner

Usually, it's better to use smaller images on mobile phone unless you have a special use case for it. Here's what I suggest:

  • If it's loaded locally you might want to convert images to a smaller size if you can.
  • If it's loaded from the web and you could modify your markdown then you could use html in markdown to change the size. If you had this ![test](https://github.com/favicon.ico) you could modify it to <img src="https://github.com/favicon.ico" width="48">

If the above does not solve your issue, feel free to add more details about you use case (local or web) and if you mean image loading is slow or the page become slow.

@falnatsheh falnatsheh changed the title MarkdownView slow Large Images takes a long time to load Apr 3, 2016
@alorma
Copy link

alorma commented Apr 3, 2016

Hi.

In my case in Gitskarios, i need the same feature, because i load a markdown file from github, but i take care of download the MD contente and then print in a textView.

Github README files usually contanins big images, or big GIF (even about 30MB)

@falnatsheh
Copy link
Owner

Is your intention to make the images load faster (Image optimization) or that visually the images will appear to load fluidly (lazy loading)?

MarkdownView just converts the markdown to HTML and load it into an Android Webview. I'll look to see if there's a javascript library that optimize/lazyload html img tag automatically (without modifying the image html tag) this could be the faster option to implement this (let me know if you know of such libraries). Otherwise, I might need to add optional data-src attribute when parsing markdown.

@gold24park
Copy link

gold24park commented Aug 19, 2016

In my case, markdownView.loadMarkDown(text) takes 90ms..
even though the text's length is only 768.
It's too slow for users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants