BuddyDev

Search

Questions about avatars

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #19771

    Hi Brajesh, I have read your guide to avatars
    https://buddydev.com/definitive-guide-buddypress-avatars/

    Here I came across some questions.

    1.
    The size of the avatars on the members list and profile page are apparently defined by BP_AVATAR_FULL_WIDTH and BP_AVATAR_FULL_HEIGHT.

    BP_AVATAR_THUMB_WIDTH and ‘BP_AVATAR_THUMB_HEIGHT’ seems to have no effect.

    What are the thump settings for, and where are thumbnails showing?

    2.
    Could you please elaborate a bit more about this section and its code, what does it do?
    ‘Want to set it dynamically? need to set the thumbs too –
    Adding Default Avatar and Thumb too?’

    3. Please explain about max width settings, what is it for?

    ‘BP_AVATAR_ORIGINAL_MAX_WIDTH’

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24712
    Brajesh Singh on #19792

    Hi Carsten,
    Thank you for the questions.

    The avatar sizes may get overridden by css(forced size). Let us keep that in mind and then see our options now.

    1. BP_AVATAR_FULL_WIDTH is used for full size avatars. By default, when you visit a user’s profile or a single group page, the display photo uses this size. It can be overridden by themes.

    BP_AVATAR_THUMB_WIDTH is used for user/group thumbnails(The size you see in directory). Widgets my use css to override it(default widgets do).

    Please do note that any change in the avatr constants will be reflected for new uploads. It won’t show for the existing uploaded avatars much.

    2. That section deals with setting default avatar images for users who have not uploaded it. By dynamically, I am referring that you can use user attributes to decide which avatr you want to show them(An example will be showing gender based avatar)

    3. BP_AVATAR_ORIGINAL_MAX_WIDTH it is the size of image used for canvas while cropping avatar. If you upload an image which has larger width/height than then, they will be scaled to this width/height as maximum. And this scaled image will be used to let you crop. Try uploading a larger image and seehow they are shown on the crop screen.

    Hope this clarifies.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #19797

    Hi Brajesh, thanks, it certainly did clarify my questions about avatars.

    One question to this comment:
    BP_AVATAR_THUMB_WIDTH is used for user/group thumbnails(The size you see in directory). Widgets my use css to override it(default widgets do).

    What controls the size of the avatars in the messages inbox and sent list, and active conversation participants, which are very smal. Is it because the style is overwritten by theme or something else?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24712
    Brajesh Singh on #19820

    Hi Carsten,
    Yes, the thumb size is used and it is constrained by passing height/width in the avatar function. You can inspect and see the constrained and original size. You can use css to override it if you need to use original size.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved