Opened 12 years ago
Closed 11 years ago
#5074 closed defect (bug) (fixed)
get_avatar() filtered by bp_core_fetch_avatar_filter() may result in stretched BP avatar
Reported by: | henrywright | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | 1.1 |
Component: | Core | Keywords: | |
Cc: |
Description
bp_core_fetch_avatar_filter() filters the get_avatar() function so that BuddyPress can attempt to find a BP avatar if one has been uploaded.
Imagine this scenario:
Set a default avatar height and width in bp-cutom.php
define ( 'BP_AVATAR_THUMB_WIDTH', 40 ); define ( 'BP_AVATAR_THUMB_HEIGHT', 40 );
Then use the get_avatar() function in the loop to display the post author's avatar
$author = get_the_author(); echo get_avatar( get_the_author_meta('ID'), 120, '', $author );
Even though an image 120px x 120px in size is outputted, the 40px x 40px BuddyPress thumb image is being used which results in a stretched avatar being displayed (see attached).
Attachments (1)
Change History (4)
#1
@
12 years ago
- Milestone changed from Awaiting Review to 1.9
- Version changed from 1.7 to 1.1
We can do a better job of detecting the size passed by get_avatar() and checking it against BP's thumb width and full width values.
Whatever width value is closest is the type we should use in bp_core_fetch_avatar().
Moving to 1.9, but might get pushed to Future Release if there are no patches by then.
avatar