[Gossip-dev] Avatar rework

Xavier Claessens xclaesse at gmail.com
Mon Nov 27 22:59:35 CET 2006


Hi all,

gossip-telepathy now supports avatars. I think some changes are needed
to get it well. Here is the main problem:

UI loads picture file into a GdkPixbuf, scale it to 96x96 and store it
into a png buffer. That's two problems ! First we don't know if the
protocol supports 96x96 size and second protocol may not support png
format.

With telepathy we can know what formats/sizes are supported and we
should make some conversions... But imagine the protocol supports only
jpeg format at 100x100 and the user loads a 100x100 jpeg file... the UI
will convert it into a 96x96 png and then the backend should convert it
again into 100x100 jpeg (the initial format/size)... that's bad !

What I suggest is to remove avatar from GossipVCard and add a new
function like:
void gossip_protocol_set_avatar (GossipProtocol *proto, const gchar
*filename);
Do we need an async API ? I think we can make the implementation async
but not notify the caller when the avatar is effectively setted.

We can also add a useful function in gossip-utils to load and convert
the image (that will be used by protocols), like:
len = gossip_load_avatar (filename, max_width, max_height, min_width,
min_height, max_size, format, &avatar_data);

Receive avatar in the vcard is absolutely useless since GossipContact's
avatar is automatically updated.

With my suggestion we are sure to have an API completely
protocol-independent, that's why telepathy have this API...

If everybody agree I can begin the work...
Comments are welcome !

Xavier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.imendio.com/pipermail/gossip-dev/attachments/20061127/af830e57/attachment.pgp


More information about the Gossip-dev mailing list