[Gossip-dev] Avatar rework
Martyn Russell
martyn at imendio.com
Tue Nov 28 09:38:05 CET 2006
Xavier Claessens wrote:
> Hi all,
Hi,
> 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.
Good point.
> 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.
Yes we need an async API. In fact, we don't use async APIs enough in my
opinion, and we certainly need to improve that (i.e. make a lot of
operations able to be cancelled).
This is necessary for UIs that have progress information about such
things. The typical scenario is, you set your avatar and you assume it
has just done it and when you go to the dialog the next time, the avatar
hasn't changed from what it was. This may have been because of some
error which we didn't present the user because we didn't have an async
callback. Users will reports bugs in such a case and you can't guarantee
it will always just work.
> 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);
Yea something like this sounds good, although I would put minimum width
first in that API.
> Receive avatar in the vcard is absolutely useless since GossipContact's
> avatar is automatically updated.
Yes, I agree to some extent, as long as this new proposal doesn't hinder
the contact/vcard relationship code wise, it sounds like a good idea. I
think the only reason we have the avatar in the vcard is purely down to
how Jabber operates, so this shouldn't be a problem.
> With my suggestion we are sure to have an API completely
> protocol-independent, that's why telepathy have this API...
Good plan.
> If everybody agree I can begin the work...
> Comments are welcome !
Keep up the good work ;)
--
Regards,
Martyn
More information about the Gossip-dev
mailing list