473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

inline images

http://us2.php.net/manual/en/functio...egif.php#20425

The above URL suggests that it's possible to sorta embed images within
an HTML document so that they don't have to be loaded via a seperate
HTTP request. The idea intrigues me, although I can't seem to get it
working. Is the idea sound or is that link just kinda bogus?

Here's my (failed) attempt:

http://www.geocities.com/terra1024/inline_gif.html

(I apologize for the mangled HTML that geocities produced)

Dec 27 '05 #1
3 2666
Op 27 Dec 2005 02:48:30 -0800 schreef "yawnmoth"
<te*******@yahoo.com>:
http://us2.php.net/manual/en/functio...egif.php#20425

The above URL suggests that it's possible to sorta embed images within
an HTML document so that they don't have to be loaded via a seperate
HTTP request. The idea intrigues me, although I can't seem to get it
working. Is the idea sound or is that link just kinda bogus?

Here's my (failed) attempt:

http://www.geocities.com/terra1024/inline_gif.html

(I apologize for the mangled HTML that geocities produced)


Try this:
<p>
Demo: You should see an image here:<br>
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAA eP4ixAAAALHRFWHRDcmVhdGlvbiBUaW1lAFR1ZSAyNiBPY3QgM jAwNCAwMDowNDoyMCAtMDAwMMDfY6EAAAAHdElNRQfUChkXBTf %2BeRCSAAAACXBIWXMAAAsSAAALEgHS3X78AAAABGdBTUEAALG PC%2FxhBQAAB1RJREFUeNrVmHlwU1UUxr%2BbrUnalFaQVpaWp SLL6IigQnFhm1FZBhWoA6igIAUcQKnKKo5QZBMVWXSgKG7jiFQ 6MIKAiDgoVXFQ%2FAMVKUKtVqB2oU3SbNfvRouxNs1LG0g4Haa vL%2Ffm3R%2FnnO%2Bc8wQuT%2BuUjJZLdNAP8sGrM8L0bLQPF K5ZzbBMs6HFqRuQWfWm2CsfEU%2F4ktHqJ0O0TxaG2WxIfNkHX 9ZYMcU4EuONBMKP%2BF5I%2BCyXBUgSWl5tgSVPAjc9KZ6L64P %2BgmH1nzW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GxsxWGICOwauHzsbn2TbnmHAe zCdGGCARR5nKgZl8czPIbfNGrGCd1GaK7msUvLFA5dBI%2F4RW 51LULW0s5Y0%2BMBQhlDcWPIEwmB6b1Rpi6DMQw863iDr8XDsh d3k%2Bx080R9yvWnSkckS9etxkBkDpLbY02091wjdZDL%2BgN9 eKt1I3aDWU4uwWIcHPWTPsLuA7uMDvFxYYAAAAASUVORK5CYII %3D"
alt="Oops, your browser seems to think that you just don't need this
functionality" title="">
</p>

Copied from:
http://www.howtocreate.co.uk/wrongWi...r=Data%3A+URIs
Read the text there.

IE 5.5 does not support it, not sure about later versions.

Bart
--
Bart Broersma
br*********************@tiscali.nl
(ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)
Dec 27 '05 #2
yawnmoth <te*******@yahoo.com> wrote:
Here's my (failed) attempt:


<img src="/-/data:image/gif;base64,R0lGODdhMgAyAI...
^^^^^
These characters are wrong and must be removed.

The URL must start with "data:" to define any inline-data.

Like "http:", "ftp:", "file:", "mailto:" the protocol part "data:" must
be the beginning of the URL. Otherwise it can't be recognized because.
If the URL would start with "/" then the URL must be treated as relative
URL and will be resolved relative to the URL of the document itself and
so the data is loaded from the web and not treated as inline data. So
the real URL would be

http://www.your-domain.com/-/data:im...;base64,R0lGOD...

But if you really want to define the data inline you have to use:

data:image/gif;base64,R0lGODdhMgAyAI...

--
Alexander
Dec 27 '05 #3

On 27 Dec 2005, yawnmoth wrote:
http://us2.php.net/manual/en/functio...egif.php#20425

The above URL suggests that it's possible to sorta embed images within
an HTML document so that they don't have to be loaded via a seperate
HTTP request. The idea intrigues me, although I can't seem to get it
working. Is the idea sound or is that link just kinda bogus?

Here's my (failed) attempt:

http://www.geocities.com/terra1024/inline_gif.html

(I apologize for the mangled HTML that geocities produced)


I have an example on my HTML Sampler page:
http://www.chebucto.ns.ca/~af380/html.html#part6a
(and a link to the appropriate RFC).

Use Something like this:

<img src="data:image/gif;base64,base64-encoded image-bytes-go-here"
alt="appropriate-alt-text">

replacing the 'base64-encoded image-bytes-go-here' with the appropriate
base64 representation of the image, adding appropriate alt text and
changing the image type if it's a JPG or PNG file. (One way to get it if
your email reader doesn't store stuff in some proprietary format is to
email the image to yourself as an attachment and then snip the raw
un-decoded base64 code from the email with a text editor. Another way is
to get the UUDEVIEW/UUENVIEW freeware package and use UUENVIEW with the
appropriate switch to encode the image and then snip our the headers it
adds to the base64 code.)

Note that this works with Firefox and Opera but IE version 6 on my machine
doesn't recognise the "data:" protocol.

--
Norman De Forest http://www.chebucto.ns.ca/~af380/Profile.html
af***@chebucto.ns.ca [=||=] (At the Sign of the Flashing Cursor)
"Oh how I miss the days when it was easier to catch gonorhea than a
computer virus." -- Big Will in alt.comp.virus, March 9, 2005

Jan 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: DJ WIce | last post by:
Hi all, I did make a script/css thing to replace the contextmenu on the website with a new one: http://www.djwice.com/contextmenu.html It works nice in MSIE, but on Netscape (and probable...
3
by: Aaron | last post by:
Hi, I'm trying to use style sheets instead of tables for layout, but I'm not sure on how to do something... I have a div (100% width) containing 3 other divs. Each needs to be lined up next to...
10
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/dev/test.html I'd like to have the colored boxes appear on the same line as "Test" does. The div containing the colored boxes is defined as being inline, yet...
3
by: Sergio | last post by:
Hi, I know how to use SmtpMail to create and send a mail message in text or HTML format. I always use the URL to the location of images on the server to include those images in my mail body....
15
by: otto | last post by:
Any suggestions? I want a sequence of composite "blocks" (e.g. image and caption representing a product category) to wrap like text as a browser is made wider/narrower. Tables are not working well...
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
7
by: massic80 | last post by:
Hi everybody! I'm making a page for an exam at uni. In two DIV blocks of it there should appear (and disappear) some "icons", due to XML messages, so I dunno how many of them should I can obtain;...
6
by: Geoff Cox | last post by:
Hello, I am using the following css ..hiddenDiv2 { display: none; } ..visibleDiv2{ display: inline;
3
by: AleXmanFree | last post by:
Hi , I have got problem with passing my inline based value to y user control (or custom control, no matter which one I use, I have tried both to make sure it doesnt matter) . So say I have...
1
by: AleXmanFree | last post by:
Hi , I have got problem with passing my inline based value to y user control (or custom control, no matter which one I use, I have tried both to make sure it doesnt matter) . So say I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.