Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#6282 closed defect (bug) (fixed)

Wrong cropping of avatar, if you don't change the selection window.

Reported by: WeddyWood Owned by: boonebgorges
Milestone: 2.3 Priority: normal
Severity: normal Version: 1.5
Component: Extended Profile Keywords:
Cc:

Description

The problem occurs if you have uploaded a photo to crop, then did not change the position and size of window to be circumcised, and then clicked on the save button. In this case, cropped avatar will be shifted relative to the center, due to the fact that originally installed the wrong coordinate values of the window of circumcision.

In file "bp-core-cssjs.php" on lile 166 is wrong calculation of init coordinates (width & height):

updateCoords({x: <?php echo (int) $crop_left; ?>, y: <?php echo (int) $crop_top; ?>, w: <?php echo (int) $crop_right; ?>, h: <?php echo (int) $crop_bottom; ?>});

To solve the problem, you just need to delete this line. Javascript (when the page is initialized itself) will set the correct initial values of the coordinates of the window for circumcision.

Change History (3)

#1 @WeddyWood
5 years ago

  • Component changed from API - Avatars to Component - XProfile

#2 @boonebgorges
5 years ago

  • Milestone changed from Awaiting Review to 2.3
  • Version changed from 2.2.1 to 1.5

Introduced in [3702]. See #2522.

I've reproduced the issue and it looks like your fix is correct. Thanks for the report!

#3 @boonebgorges
5 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 9606:

Let jCrop set initial crop coordinates on its own.

Our calculation was skewing picture dimensions, and is unnecessary.

Props WeddyWood.
Fixes #6282.

Note: See TracTickets for help on using tickets.