[uf-discuss] hCard, "photo" element: Inlined or embedded images according to rfc 2397?

Tobias Prinz tobiasprinz at gmx.net
Fri Dec 11 03:34:07 PST 2009


Hello there,

I am currently implementing hCard as import/export standard for a 
company I work with. So their main point is to exchange all contact 
data, which includes an associated image. Since we are talking about 
real im/export, the actual image is needed and not a link to it (also, 
the product does not allow using external links for images... hmpf).

I think the most convenient way to do this would be using an inline(*) 
image within the html page. That exports the image itself (requirement) 
and keeps it all to one file, which makes it a lot easier to handle 
(uplods via http post, directory on web servers, etc.)

So, here is the question: Does hCard actually support this? vCard does 
something similar (se 3.1.4 in the rfc). If nothing else is said about 
that, then I figure that means "yes", but:

The main definition only mentions URLs, which I usually take as a hint 
that people were only thinking about web links (not that I am a big fan 
of the url/uri naming schism). So this is the basic question "has anyone 
thought about this yet?", and if "is this the way to do it?", because, 
of course, the behaviour of vCard cannot be copied directly and I might 
be missing another way to do it.

Of course I also have to check whether the parser I am currently using 
supports this, too (which is independent of the standard), but right I 
am more interested in the standard itself.

Kind regards,
Tobias Prinz


*) I haven't seen that done in a while, so it might not be a common 
thing to do, so here the short explanation: Instead of having a link, 
you use a base64 encoded string within the file. This is allowed because 
w3c allows any kind of URI as source for the src attribute of an image, 
and rfc2397 defines the data url scheme. And quick tests showed me that 
it works in all browsers I have installed. Yay!

P.S.: Is there no way to search the mailing lists? I could not find one, 
so I stuck with google: 
site:http://microformats.org/discuss/mail/microformats-discuss/ "inline 
image" which netted one one result that was not related, "embedded 
image" got me zero results.


More information about the microformats-discuss mailing list