HTML IMG tag.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML IMG tag.

João Miguel Lopes Moreira


Lisbon, 10 of October of 2008.

There is a way to include in the HTML ASCII file, the binary source of an image file, like a .gif file?

Solution: http://lists.w3.org/Archives/Public/www-html/2008May/0028.html

Another problem is that, the implemented solution, uses MIME to set data content type.

But when HTML have:
IMG SRC="file:\\image_file.gif"

I think it uses .gif to set data content type, and not a preset MIME, if MIME is used, is used by the browser, that query the O. S., or other, about the MIME for the .gif extension.

So, I think it would be great to have the image binary data, without reference to MIME, but, also, with reference to file extension, and let browser decide which content is there, as if a file name was supplied.

Instead of having only HTML:
IMG SRC="data:image/gif;base64,ZXYetc..."

Having also HTML:
IMG SRC="data:.gif;base64,ZXYetc..."

(JMLM).
_________________________________________________________________
Obtenha 30 Emoticons grátis para o seu Windows Live Messenger
http://www.livemessenger-emoticons.com/funfamily/pt-pt/
Reply | Threaded
Open this post in threaded view
|

Re: HTML IMG tag.

Elliott Sprehn
On Fri, Oct 10, 2008 at 11:37 AM, João Miguel Lopes Moreira
>
> Instead of having only HTML:
> IMG SRC="data:image/gif;base64,ZXYetc..."
>
> Having also HTML:
> IMG SRC="data:.gif;base64,ZXYetc..."

File extensions are really meaningless in the context of the web. The
MIME type is the standardized way to determine the format of a file.

File extensions may also be mapped to entirely different formats on
different machines or on the same machine, or the machine might not
even use file extensions. For instance .m files are used by both
Objective-C for implementation files, and by MatLab for code files,
and probably by other things as well.

Many websites deliver HTML, images, scripts or CSS without a file
extension, and nothing prevents you from mapping .awesome to image/gif
on your server.

So using the extension in the <img> tag wouldn't make sense at all
since the extension is really meaningless. What's important to the
browser is the mime type. In the event you load a file from disk it's
up to the operating system (and the UA running on it) to determine the
type of file.

Ex.
<img src="file:///foo.awesome" title="actually a GIF">

The browser should, using the OS facilities, figure out what kind of
file this is. If the OS depends on file extension then of course this
might not load correctly, however maybe it uses some kind of file
metadata (like classic Mac OS, and somewhat OS X), or it uses the *nix
"file" command to do an analysis. The behavior, though, is totally
platform specific.

It should be noted that the IETF specified the standard for Data URIs
(which is what you're talking about), so it's not like the W3 could
change what you want anyway.

<http://tools.ietf.org/html/rfc2397>

- Elliott