Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 3 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);

… and this is what I see http://i.share.pho.to/1c4f196e_o.png

Attachments (1)

1c4f196e_o.png (506.7 KB) - added by m1000 5 years ago.

Download all attachments as: .zip

Change History (3)

@m1000
5 years ago

#1 @boonebgorges
5 years ago

  • Component changed from Core to Avatars
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

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#L158

I 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.

#2 @DJPaul
3 years ago

  • Component changed from API - Avatars to Media
Note: See TracTickets for help on using tickets.