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 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.

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:35 am
Powered by Dreamwidth Studios