BuddyDev

Search

Replies

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #49012

    Hi Brajesh, thank you again for spotting this issue.
    This is not a custom css, neither from the buddypress.min.css file, so where does this rule belong?

    Apparently it is not possible to overwrite in custom css, so how can I delete or change this?

    img[Attributes Style] {
        width: 50px;
        aspect-ratio: auto 50 / 50;
        height: 50px;
    }

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48998

    Except for this:

    https://imgur.com/hKXUqyL

    Why is the “Who’s Online” widget avatar not sized the same as the “Most Visited Users” widget avatars?

    All custom css is turned off.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48975

    Hi Brajesh, thanks for the clarification, now it all make sense.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48971

    Hi Brajesh, thank you for informing me.

    When I change the size to 50x50px, of course the avatars gets smaller.

    https://imgur.com/8NoHGJz

    If I want to maintain bigger avatars 110×110, in widgets, and 450x450px in profile like in this illustration, what would be the correct procedure instead of css?

    https://imgur.com/ovjKoWE

    Regards
    Carsten

    • This reply was modified 1 year, 8 months ago by calu.
  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48969

    Hi Brajesh, thank you, now my avatars are sharp in the profile header, but the avatars in the widgets are not.

    https://imgur.com/YgI3gua

    “if you use thumb at larger than 50 and full larger than 150px, they will not look sharp.”

    But an avatar smaller than that, like in a widget, should be sharp then?

    In which case should I use the code below?

    Regards
    Carsten

    if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) )
        define( 'BP_AVATAR_THUMB_WIDTH', 50 ); //change this with your desired thumb width
     
    if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
        define( 'BP_AVATAR_THUMB_HEIGHT', 50 ); //change this with your desired thumb height
     
    if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) )
        define( 'BP_AVATAR_FULL_WIDTH', 260 ); //change this with your desired full size,weel I changed it to 260 :)
     
    if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) )
        define( 'BP_AVATAR_FULL_HEIGHT', 260 ); //change this to default height for full avatar
  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48963

    Hi Brajesh, if you are not using Member Types Pro or the changing default avatar code, does BP then create two sizes of avatars, a 50×50, and an 150x150px of the image you upload and crop?

    Where are they stored?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48962

    Hi Brajesh, so where is BP using the two formats, thumbnail size 50×50 for widgets and directories, and full size on profile page?

    You wrote that BuddyPress sets 2 sizes(thumbnail 50px, full 150px).

    But if you are using Member Types Pro, the full image size is 260×260?

    https://imgur.com/ul80OtB

    “if you use thumb at larger than 50 and full larger than 150px, they will not look sharp.”

    Just to clarify, so if I want to use larger than 150px, eg. 450px for my full width size on mobile, I should just add this size to this code?
    https://buddydev.com/changing-default-avatar-size-croppedused-by-buddypress/

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48952

    Hi Brajesh, thanks for in detail pointing at where the issue is in my custom css file.
    I’t strange, because I tested the issue with another theme, bypassing my custom css, but it was still blurred. It might have been a caching issue.

    The images is still not as sharp as when they are in the cropping tool, but I guess this is befor the 50×50 px compression. When the avatar then is enlarged like in this mobile view, it gets a little blurred.

    https://imgur.com/9HqXuoL

    For having the avatar full size on mobile, covering the cover image and the whole item header, I’m using this css code:

    @media (max-width: 768px)
    #item-header-cover-image #item-header-avatar img {
        width: 450px;
        padding-top: 20px;
    }

    Does this code setting the width to 450px, effect the sharpness as well, as the css you pointet out?

    If yes, how do I achieve an avatar in full width on mobile without blurring?

    Should I be using the snippet from here

    https://buddydev.com/changing-default-avatar-size-croppedused-by-buddypress/

    Setting the BP_AVATAR_FULL_WIDTH’, to 450px?

    Is that how I should understand the use of this snippet?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48927

    Hi there, I’m using this snippet to use different default avatar based on BuddyPress Member Types.

    The image size was set to 300×300 so maybe this was causing the issue?

    I changed the avatar sizes to 50×50 so now they are all blurry. What can I do about that?

    https://imgur.com/b3lHV9e

    Regards
    Carsten

    //Using different default avatar based on BuddyPress Member Types
    
     function buddydev_set_default_use_avatar_based_on_member_type( $avatar, $params) {
        $user_id = $params['item_id'];
     
        $type = bp_get_member_type( $user_id );
     
        if ( $type == 'man' ) {
            $avatar = 'https://domain/wp-content/uploads/2021/08/Avatar-man-50x50-1-e1679832244590.jpeg';
        } elseif( $type =='woman' ) {
            $avatar = 'https://domain/wp-content/uploads/2021/08/Avatar-woman50x50-1-e1679831984556.jpeg';
        } else {
            $avatar = 'https://domain/wp-content/uploads/2022/08/mystery-man.jpeg';//get_template_directory_uri() . '/assets/images/unknown.png';
        }
     
        return $avatar;
    }
     
    add_filter( 'bp_core_default_avatar_user', 'buddydev_set_default_use_avatar_based_on_member_type', 10, 2 );  
    
  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Blurry-avatar-images #48926

    Hi Brajesh, thank you for investigating this issue on my page.

    You wrote that problem is that I’m using css to force the image to have a dimension quiet larger than the original one.

    I tested the issue with another theme, without any custom css, with same result. Please clarify what css that might be?

    https://buddydev.com/changing-default-avatar-size-croppedused-by-buddypress/
    By default, Buddypress allows thumb size to be 50×50 (pixels) and full size to be 150px X 150 px.

    I don’t necessarily want an avatar size greater than 150px, and I don’t think I have made any changes to this, where do I find this setting, nothing under Options about avatar size anymore?

    Does this have anything to do with the WP Dashboard Media settings, what should the image sizes be for Thumbnail, Medium and Large here?

    Regards
    Carsten