Another problem is that, the implemented solution, uses MIME to set data content type.
But when HTML have:
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:
Having also HTML:
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.
<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
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.