mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #24861
[Bug 1419532] Re: Add "width" and "Height" attributes to <img> tag in image blocks so they'll flow to the right size immediately
Hm, one thing that does work, in my testing, is if I use an embedded
(base64-encoded) image as the src, and then I add an "onload" command
that loads the real image.
For testing the principle, I just manually generated an empty png file
of the correct size, but in practice we'd have to generate one on the
fly. So it would look like this:
1. Generate an empty png file of the same image dimensions as the actual
image file. Compress this PNG file as much as possible.
2. Base64-encode the placeholder PNG file.
3. Use this for the HTML in the block:
<img src="data:image/png;base64,iVBORw0KGgoAAAANS..."
onload="this.src='{$src}';" alt="{$description}" itemprop="contentURL">
But, I have no idea whether the act of generating, compressing, and
encoding the placeholder PNG file, might actually take so long that it
slows down pageload itself. I guess it would be a tradeoff. Generating a
placeholder PNG to embed into the HTML extends the time for the web
server to generate the HTML of the page itself; but it decreases the
time for the browser to determine the final page layout geometry.
Well, it's something to think about for 15.10 maybe.
** Changed in: mahara
Milestone: 15.04.0 => None
** Changed in: mahara
Milestone: None => 15.10.0
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1419532
Title:
Add "width" and "Height" attributes to <img> tag in image blocks so
they'll flow to the right size immediately
Status in Mahara ePortfolio:
Won't Fix
Bug description:
We should add "width" and "Height" attributes to the <img> tags
generated by image blocks, so that the browser will render the image
placeholder as the correct size even before the image finishes
loading. This should help the page to feel like it's loading up more
quickly.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1419532/+subscriptions
References