MarkdownView icon indicating copy to clipboard operation
MarkdownView copied to clipboard

Large Images takes a long time to load

Open SoerenBusse opened this issue 8 years ago • 4 comments

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?

SoerenBusse avatar Apr 03 '16 00:04 SoerenBusse

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 avatar Apr 03 '16 02:04 falnatsheh

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)

alorma avatar Apr 03 '16 06:04 alorma

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.

falnatsheh avatar Apr 03 '16 12:04 falnatsheh

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

gold24park avatar Aug 19 '16 14:08 gold24park