Avatar rework
Xavier Claessens <[email protected]> Mon, 27 Nov 2006 22:59:35 +0100
| Newsgroups | gmane.comp.gnome.gossip.devel |
|---|---|
| Message-ID | <1164664775.4931.21.camel@zdra-desktop> |
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. _______________________________________________ Gossip-dev mailing list [email protected] http://lists.imendio.com/mailman/listinfo/gossip-dev
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFa1/H6dEBUn2qPAMRAlFyAJ99GP2TF9LHYWIjvD3KS4V5ycSuWgCfT9oA SCztXMTLVn92lyEd4CzbOhM= =4MYW -----END PGP SIGNATURE-----