venta: (Default)
[personal profile] venta
Dull survey: does your web browser of choice support the data:// scheme, as defined in RFC 2397 ?

Quick check:

If you can see a little picture of a face here, the answer is "yes". If you see some form of red-x/image-not-available thing, that's a "no".

Larry

If you could comment, letting me know which browser you're using, that'd be great.

To save an immediate flurry of duplicate comments, IE6 doesn't support it :)

Date: 2004-08-13 08:05 am (UTC)
From: [identity profile] voratus.livejournal.com
Firefox 0.9.3 can.
I'm curious as to why one would actually use this, as it seems it can only do the same thing that other code can currently do.

Date: 2004-08-13 08:09 am (UTC)
From: [identity profile] venta.livejournal.com
If you use a data URL then you supply the data in the data for the image (or whatever) embedded directly in the URL itself. There is no requirement for further downloading, as there would be if you used an http URL or similar.

So, I could, for example, send you an email which was full of hyperlinks. Once you'd downloaded the mail, you could go off-line but still be able follow all the links. I'm not sure of another way to do this, do you know of one ? I suppose you could attach all the things behind the links as extra files, but that could get rather clumsy.

Date: 2004-08-13 08:44 am (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
The other cool application for data: stuff being something like javascript generated images. There are competitions I've seen that have cool web pages in under 4k or something and I've seen them do things like really complicated fractals with this method (I think). Never understood it at the time because I was only baby in terms of the web. :)

Date: 2004-08-13 09:04 am (UTC)
From: [identity profile] voratus.livejournal.com
So using data to display an image, you're putting the actual hex code for the image data in it, so the image is actually a visual display of code in the page itself then, right?
If so, how do you get that data string from an image to code it?

Date: 2004-08-13 09:07 am (UTC)
From: [identity profile] venta.livejournal.com
So using data to display an image, you're putting the actual hex code for the image data in it

Indeed. The html for the above face is:

<IMG
SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
hhx4dbgYKAAA7"
ALT="Larry">

If so, how do you get that data string from an image to code it?

Now that, I'm afraid, I don't know the answer to. I pinched the above code from the RFC, I have no idea how to generate my own, I'm afraid.

Date: 2004-08-13 09:09 am (UTC)
From: [identity profile] voratus.livejournal.com
Well then, I must say that data: is a Groovy Thing™.

Date: 2004-08-13 11:24 pm (UTC)
From: [identity profile] bateleur.livejournal.com
As long as it's used Only For Good (TM).

The potential for badness is great, since it means you no longer have the option not to load the non-text data for the page.

For example: Suppose I am loading someone's homepage using a dialup link and I just want the email address at the bottom and not the 2MB .bmp of their cat which sits at the top of the page. Normally this is easy, but with 'data:' it becomes impossible.

Date: 2004-08-13 09:11 am (UTC)
From: [identity profile] voratus.livejournal.com
Perhaps opening the file in a hex editor?

Date: 2004-08-13 09:13 am (UTC)
From: [identity profile] voratus.livejournal.com
Actually, that wouldn't work, because it would give you hex, not ascii, which is what the code apparantly is.
Maybe getting the hex from a hex editor and then converting that to ascii?

Head splodey!

Date: 2004-08-13 09:46 am (UTC)
From: [identity profile] voratus.livejournal.com
Scratch that idea. I don't think it's ascii after all, but some sort of mime encoding.

Date: 2004-08-13 09:49 am (UTC)
From: [identity profile] wechsler.livejournal.com
wechsler@heifong:~/scripts$ php -q
<?php print(base64_encode(file_get_contents('../Untitled-1.gif'))); ?>
^D

Date: 2004-08-13 11:23 am (UTC)
From: [identity profile] onebyone.livejournal.com
I can't vouch for the non-virus-iness of the windows executable, but you could try this: http://www.fourmilab.ch/webtools/base64/

Date: 2004-08-13 11:43 am (UTC)
From: [identity profile] voratus.livejournal.com
That did it, which allows me to do this:
data img

Date: 2004-08-13 11:28 am (UTC)
From: [identity profile] onebyone.livejournal.com
[Work only] "help lib/mime/base64", in case you need to.

Date: 2004-08-13 09:31 am (UTC)
From: [identity profile] http://users.livejournal.com/_corpse_/
I suppose you could attach all the things behind the links as extra files

What, you mean like the last version of IE I used did?

but that could get rather clumsy

What, you mean like the last version of IE I used was?

Alternative

Date: 2004-08-14 03:37 pm (UTC)
From: (Anonymous)
Another way of doing this that worked on IE (but I don't think it does in mozilla), is to use MHTML. It appears to be basically multipart MIME encoded messages, so you reference the other parts rather than directly inserting the data.

Date: 2004-08-15 03:11 am (UTC)
From: [identity profile] neilh.livejournal.com
You could get it served as multipart/mixed, with a bunch of files all put inside a multipart MIME wrapper, but I don't think thats particularly widely supported yet, either.

Profile

venta: (Default)
venta

December 2025

S M T W T F S
 123456
78910111213
14151617181920
212223 24252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 28th, 2025 03:33 am
Powered by Dreamwidth Studios