Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#6560 closed defect (bug)

Avatar Cropper JS Width and Height reversed

Reported by: t3hpwninat0r Owned by:
Milestone: Priority: high
Severity: major Version: 2.3.2
Component: Core Keywords: needs-patch
Cc:

Description

When using a non-square width and height in my theme's functions.php like so:

if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
define( 'BP_AVATAR_THUMB_WIDTH', 40 );
 
if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
define( 'BP_AVATAR_THUMB_HEIGHT', 60 );
 
if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
define( 'BP_AVATAR_FULL_WIDTH', 120 );
 
if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
define( 'BP_AVATAR_FULL_HEIGHT', 180 );

The crop selection area is landscape when it should be portrait.
The preview, in portrait, shows the selection stretched to fit and the file is still stretched when saved.

bp-core/js/avatar.js line 530 reads:

selection = {}, crop_top, crop_bottom, crop_left, crop_right, nh, nw;

it should be:

selection = {}, crop_top, crop_bottom, crop_left, crop_right, nw, nh;

avatar.min.js should be regenerated after this change. This change is tested and working on current stable releases in my development server.

Attachments (1)

cropbug.png (119.9 KB) - added by t3hpwninat0r 5 years ago.
image is cropping landscape when it should be portrait

Download all attachments as: .zip

Change History (2)

@t3hpwninat0r
5 years ago

image is cropping landscape when it should be portrait

#1 @imath
5 years ago

  • Milestone Awaiting Review deleted
  • Status changed from new to closed

This was fixed in 2.3.2, but a problem occured during the build process for the minified version of the script. So you just need to replace avatar.min.js with a copy of avatar.js that you will call avatar.min.js in the /bp-core/js directory.

See #6551 & #6479

Note: See TracTickets for help on using tickets.