Introduction

JEP-0038 is a Jabber Enhancement protocol to have a standardized way of specifying emoticons (smileys, ascii-art,... further called "icons") so that a user can download them and use them in any client. Although I already like that JEP, I would like to add 2 things.

The first follows by adding a requirement: "Beyond Jabber". Before you think it's a movie, let me explain it: there are a lot more programs using icons then just IM clients. There are discussion boards, e-mail clients, irc-clients and probably some more. If you want to go beyond Jabber, you have to be as generic as possible.

The second is a less important one, but still. Currently, all the meta information is directly a child of the root. Logically seen, it should be in a meta-element.

More information

"Beyond Jabber"

The JEP now thinks of an icon as being a "graphic" or/and a "sound". At first sight, this seems a good categorisation. Eg., a sound can hava a volume parameter, while a graphic can't. But the problem is that categorisation of multimedia file is a difficult task: what do you have to do with a .gif vs a .png: you can define a playcount for the first, but not for the second. Another problem is where a Flash object or a java applet should fit, they aren't just "graphics" nor "sounds".

The w3c has faced the same problem with the <img> tag: it was just too restrictive to define all the multimedia files. So I think we better don't make the same mistake. Instead of doing a hack, they started from a new tag: <object> of which they say:

Previous versions of HTML allowed authors to include images (via IMG) and applets (via APPLET). These elements have several limitations:

So my point is to go with the w3c-way and also defining a general object tag for JEP38. There are two key things about this tag:

This will all become clear with some examples.

Meta-tag

The only reason I heared against a meta-tag is that it doesn't add value to JEP38. I personally don't think that's true. Suppose you are writing a webpage where people can download .jisps to try out. People need a link to where the .jisp is actually stored, but they will also need meta-information. A general parser can be written to return everything inside some tag, say the meta-tag. Without a meta-container, you can't make use of a generic method, because you'll need to parse the icondef.xml to find all the bits and pieces that form the meta-information.

Examples

In this section, I'll try to give some examples that should clearify some things. The orange ones are compliant with the current JEP, the grey ones are based on my proposal. Just to make things clear: it's the mime-type that defines the kind of multimedia file and not the extension!

Basic usage

Probably the most basic usage is just displaying a graphic, say a .png:

<icon>
	<text xml:lang="x-ascii">c|_|</text>
	<text xml:lang="x-msn">(b)</text>
	<text xml:lang="en">:beer:</text>
	<graphic mime="image/png">beer.png</graphic>
</icon>

So, if the user types c|_|, (b) or :beer:, this will be shown as beer.png. But bear in mind that there is duplication of information: the mime-type says it's about an image (namely a png), but also the surrounding tag, namely "graphic" says it's about a graphic. My opinion is that the mime type already has enough information, so, I would go for:

<icon>
	<text xml:lang="x-ascii">c|_|</text>
	<text xml:lang="x-msn">(b)</text>
	<text xml:lang="en">:beer:</text>
	<object data="beer.png" mime="image/png"/>
</icon>

Another example is the combination with a sound:

<icon>
	<text xml:lang="x-ascii">:-)</text>
	<graphic mime="image/png">smiley.png</graphic>
	<sound mime="application/ogg">haha.ogg</sound>
	<choir.wav
</icon>
<icon>
	<text xml:lang="x-ascii">:-)</text>
	<object data="smiley.png" mime="image/png"/>
	<object data="haha.ogg" mime="application/ogg"/>
</icon>

More advanced usage: offering alternatives

Now suppose that I'm great at doing Flash (suppose! ;) ). Of course I know that not every client will support Flash, so I record the sound (haha.ogg) that comes with the Flash object (smiley.swf) and I take a screenshot (smiley.png).

<icon>
	<text xml:lang="x-ascii">:-)</text>
	<graphic mime="application/x-shockwave-flash">smiley.swf</graphic>
	<graphic mime="image/png">smiley.png</graphic>
	<sound mime="application/ogg">haha.ogg</sound>
</icon>

This one isn't straightforwarded: first of all, Flash is more than just a "graphic". Secondly, I can't easily express that Flash is actually my first choice. I could make the png-graphic-tag and the sound-tag children of the flash-graphic-tag, but sound isn't a graphic. So a better idea could be:

<icon>
	<text xml:lang="x-ascii">:-)</text>
	<object data="smiley.swf" mime="application/x-shockwave-flash">
		<object data="smiley.png" mime="image/png"/>
		<object mime="application/ogg">haha.ogg/>
	</object>
</icon>

This one is actually much more straightforwarded: an object can "contain" other objects, whatever they are and you can easily express a hiearchy.

Advanced usage: passing parameters

Now there might be some parameters that you want to give with your multimedia object file. Eg. it could be that you really love animated graphics (gif,mng,...), but you don't want them jumping and moving all around the place, you only want them to be animated twice. As the current JEP doesn't offer that capability, let's start with:

<icon>
	<text xml:lang="x-ascii">:-)</text>
	<object data="smiley.gif" mime="image/gif">
		<param name="PlayCount" value="2"/>
	</object>
	<object mime="application/ogg">haha.ogg/>
</icon>

I would personally keep this as a possible option for the future, but I wouldn't specify it right away with JEP-0038.

Conclusion

Going the w3c-way doesn't lower the value of the current JEP at all, there are even more possibilities and it's (IMHO), much more straightforwarded and more simple to understand. Also, take eg. Jabberzilla, it's a Jabber client that can be installed in the sidebar of Mozilla (I don't think it's usable yet for the end user, but I think it's a great project): Jabberzilla will be able to use the rendering capacities of Mozilla to render JEP-38 compliant emoticons, what would be a great advantage, because there isn't need for another rendering engine! Maybe that Jabber clients even are the next generation browsers :D!

There still 2 problems that have to be solved:

  1. The w3c object-tag offers much more possibilities then will be necassary. This one is simular to the fact that there is XHTML, even XHTML basic, but Jabber clients only need a subset (so still compliant with XHTML!) of that: nl. XHTML IM. So there should be written a subset (=>compliance!) of the w3c object-tag specification.
  2. I don't know if the parameters are standardized for a certain mime-type. Anybody some more info on this point?

Appendix: Complete example

This example is the modified of the official one.

<?xml version='1.0' encoding='UTF-8'?>
<icondef>
<meta>
<name>Gold Angelic</name>
<version>1.0.0</version>
<description>Angelic faces and themes with gold highlights.</description>
<author jid="theo@theoretic.com">Adam Theo</author>
<author jid="cbas@rhymbox.com">Sebastiaan Deckers</author>
<author jid="cobnet@jabber.org">Mattias Campe</author>
<creation>2002-10-31</creation>
<url>http://icon-styles.jabberstudio.org/pkgs/gold_angelic-1.0.0<url>
<home>http://icon-styles.jabberstudio.org/Gold_Angelic</home>
</meta>
<icon>
<text>:-)</text>
<text>:)</text>
<object data="happy.png" mime="image/png"/>
<object data="choir.wav" mime="audio/x-wav"/>
</icon>
<icon>
<text>:-(</text>
<text>:(</text>
<object data="sad.png" mime="image/png"/>
<object data="boohoo.wav" mime="audio/x-wav"/>
</icon>
<icon>
<text>:-O</text>
<text>:O</text>
<object data="shocked.svg" mime="image/svg+xml"/>
</icon>
<icon>
<text xml:lang="en">::man::</text>
<text xml:lang="de">::mann::</text>
<text xml:lang="cs">::muz::</text>
<text xml:lang="x-msn">(z)</text>
<object data="man.png" mime="image/png"/>
</icon>
<icon>
<text xml:lang="en">::woman::</text>
<text xml:lang="x-msn">(x)</text>
<object data="woman.svg" mime="image/svg+xml">
<object data="woman.png" mime="image/png"/>
</object>
</icon>
<icon>
<text xml:lang="en">::alert::</text>
<object data="red-exclamation-mark.svg" mime="image/svg+xml">
<object data="alert.wav" mime="audio/x-wav">
<object data="alert.ogg" mime="audio/x-ogg"/>
</object>
</icon>
</icondef>

Valid XHTML 1.0! last updated: 24/03/03