Menu

#6 Add support for different avatar size

open
nobody
None
5
2007-08-13
2007-08-13
No

Some people like to have huge avatar. People like me, do not like to see such big avatars and thus want smaller avatars.

This patch tries to implement different sized avatars depending of the current buffer.

In roster buffer, we default to 32x32 sized avatars whereas in chat buffer, we want 96x96. Please review.

This patch should apply on CVS HEAD (as of 2007-08-13)

Discussion

  • Xavier Maillard

    Xavier Maillard - 2007-08-13

    set-different-avatar-size

     
  • Magnus Henoch

    Magnus Henoch - 2007-08-13
    • milestone: 328901 -->
     
  • Magnus Henoch

    Magnus Henoch - 2007-08-13

    Logged In: YES
    user_id=920364
    Originator: NO

    Nice ☺ I haven't gotten it to work, though (no avatars displayed anywhere, no JID symbol has any avatar-related properties). A few other notes:

    jabber-avatar-resize-command should have default value (executable-find "convert"), without the quote.

    jabber-avatar-create-resized-avatar uses avatar through its dynamic scope; it would be nice to have it as an argument. Also, `jabber-avatar-width' doesn't exist anywhere else.

    jabber-avatar-find-cached should probably return true only if the resized variants are already cached, too. This makes repopulating an existing cache possible.

    It would be nice if jabber-avatar-create-resized-avatar could run "convert" in the background, with start-process or something.

    It's not very hard to limit jabber-avatar-size-alist to 'roster' and 'chat'; I can do it later if you want.

     
  • Xavier Maillard

    Xavier Maillard - 2007-08-13

    Logged In: YES
    user_id=597884
    Originator: YES

    Thank you for reviewing and commenting the patch.

    >jabber-avatar-resize-command should have default value (executable-find
    >"convert"), without the quote.

    Fixed. It has already been reported.

    >jabber-avatar-create-resized-avatar uses avatar through its dynamic scope;
    >it would be nice to have it as an argument. Also, `jabber-avatar-width'
    >doesn't exist anywhere else.

    Gotcha ! There was dead code. Avatar is no longer used (and is useless in my case). The same apply for jabber-avatar-width. FIXED.

    >jabber-avatar-find-cached should probably return true only if the resized
    >variants are already cached, too. This makes repopulating an existing
    >cache possible.

    Good idea ! My approach is quite simple: either my filelist is populated by 3 members (original, chat and roster) and I return the car of the list, or nil.

    I think I need to take care of the order of the member so that I do not return the wrong avatar.

    FIXED.

    >It would be nice if jabber-avatar-create-resized-avatar could run
    >"convert" in the background, with start-process or something.

    FIXED to. I am now using `start-process-shell-command'

    >It's not very hard to limit jabber-avatar-size-alist to 'roster' and
    >'chat'; I can do it later if you want.

    Please do so :)

    There are still few glitches I want to "fix":
    1. let the user choose if they want the same directory for all cached objects or separate
    2. let the user choose the prefix/suffix of the roster/chat avatar cached files
    and things like that

     
  • Xavier Maillard

    Xavier Maillard - 2007-08-14

    Add different avatar size support in jabber-avatar.el

     
  • Xavier Maillard

    Xavier Maillard - 2007-08-14

    Logged In: YES
    user_id=597884
    Originator: YES

    This is my second try taking into account previous comments.

    Note: this patch does not touch jabber-roster.el or jabber-chat.el so you have to manually change (get buddy 'avatar) to (get buddy 'roster-avatar) and (get buddy 'chat-avatar) respectively in order this to work. Next patch will contain such modifications but till this one is validated, I won't submit them.
    File Added: jabber-roster-different-avatar-sizes.patch

     
  • Magnus Henoch

    Magnus Henoch - 2007-08-15

    Logged In: YES
    user_id=920364
    Originator: NO

    I found a bug ☺

    The argument to jabber-avatar-set can be either an avatar object or a string, but (avatar-roster-file avatar) can only handle avatar objects.

     
  • Magnus Henoch

    Magnus Henoch - 2007-08-15

    Logged In: YES
    user_id=920364
    Originator: NO

    Besides, roster and chat should be #'ignore by default in that function.

     

Log in to post a comment.