Hi Carsten,
You need to make sure that the image dimension that you are using is less than or equal to the cropped image.Since BuddyPress sets 2 sizes(thumbnail 50px, full 150px), if you use thumb at larger than 50 and full larger than 150px, they will not look sharp.
You can use the code from my post to set your own larger avatar sizes.
Regards
BrajeshHi 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?
“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
CarstenHi Carsten,
Thank you for the replies.
Member Types Pro will not have any effect on your css/avatar other than it filters the default avatar.Regards
BrajeshHi Brajesh, thank you, now my avatars are sharp in the profile header, but the avatars in the widgets are not.
“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
Carstenif ( ! 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
Hi Carsten,
Thank you.I had a look at the widget. The widget is using thumbnail and the size it uses is 50px but you are using css to force it to be 110px and that is causing the issue.
Regards
BrajeshHi Brajesh, thank you for informing me.
When I change the size to 50x50px, of course the avatars gets smaller.
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?
Regards
Carsten- This reply was modified 1 year, 9 months ago by calu.
Please make sure to change this
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
to
if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) ) define( 'BP_AVATAR_THUMB_WIDTH', 110 ); //change this with your desired thumb width if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) define( 'BP_AVATAR_THUMB_HEIGHT', 110 ); //change this with your desired thumb height if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) ) define( 'BP_AVATAR_FULL_WIDTH', 450 ); //change this with your desired full size,weel I changed it to 260 :) if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) ) define( 'BP_AVATAR_FULL_HEIGHT', 450 ); //change this to default height for full avatar
That should help you resolve it.
Regards
BrajeshExcept for this:
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
You must be logged in to reply to this topic.