Opened 10 years ago
Last modified 8 years ago
#5923 new defect (bug)
Can't change size of group thumbnail since 2.1 version
Reported by: | m1000 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | needs-patch |
Cc: |
Description
Hi
Since 2.1 version of BP I can’t change shape of crop tool. I pasted this code in functions.php (twentyfourteen theme)
function group_thumbnail_size(){ define( 'BP_AVATAR_FULL_WIDTH', '180'); define( 'BP_AVATAR_FULL_HEIGHT', '120' ); } add_action('bp_init', 'group_thumbnail_size', 2);
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
See #5617 and r8673.
It was never really possible to customize the size and shape of the crop box directly. Before r8673, the cropper was automatically sized to half the height and half the width of your image. But we stopped doing that in all cases, because it was resulting in a suggested crop size that was smaller than the avatar full dimensions, which in turn was resulting in upsized avatar images when displayed on profile pages.
However, now that I look over the changes, it does look like we didn't take account of the proportion between height and width, and that appears to be what's causing the problem here. In addition, we are casting the calculated
$aspect_ratio
to an int, which is also probably part of the problem. See 163 https://buddypress.trac.wordpress.org/browser/tags/2.1/src/bp-core/bp-core-cssjs.php#L158I guess I'd start the investigation by looking at the aspect ratio, and then working backward. It'd be great to get a patch to fix this for 2.2.