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

1 view
Skip to first unread message

Tobias Prinz

unread,
Dec 11, 2009, 6:34:07 AM12/11/09
to microforma...@microformats.org
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.
_______________________________________________
microformats-discuss mailing list
microforma...@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss

Brian Suda

unread,
Dec 11, 2009, 6:59:11 AM12/11/09
to tobia...@gmx.net, Microformats Discuss
On Fri, Dec 11, 2009 at 11:34 AM, Tobias Prinz <tobia...@gmx.net> wrote:
> I think the most convenient way to do this would be using an inline(*) image
> within the html page. ...

> So, here is the question: Does hCard actually support this?

--- it should yes. The vCard allows you to have BASE64 encoded data.
If you put a URL in there, most address book applications ignore it.

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

--- I have been using the data uri scheme on my site
http://suda.co.uk/contact/ and i didn't think that the data uri worked
in all versions of IE, instead they got a broken image.

Please post your findings on the wiki so we can document browser and
PIM usage and acceptance.

> P.S.: Is there no way to search the mailing lists? I could not find one, so
> I stuck with google:

That or some of the other mailing list archiving applications are the
best way to search the mail archives.

-brian


--
brian suda
http://suda.co.uk

Toby Inkster

unread,
Dec 11, 2009, 7:47:23 AM12/11/09
to tobia...@gmx.net, Microformats Discuss
On Fri, 2009-12-11 at 12:34 +0100, Tobias Prinz wrote:
> 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.

Swignition <http://buzzword.org.uk/swignition/> does support RFC2397
data URLs. When it outputs vCard it converts them on the fly to
"PHOTO;TYPE=BASE64:" properties which seem to be better supported in
address book apps than data URLs are.

The Swignition web service is down right now, but the Perl library and
command line app is still available for download.

--
Toby A Inkster
<mailto:ma...@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Reply all
Reply to author
Forward
0 new messages