Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 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
Priority: normal Milestone: 2.3
Component: Extended Profile Version: 1.5
Severity: normal 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
11 years ago

  • Component API - AvatarsComponent - XProfile

#2 @boonebgorges
11 years ago

  • Milestone Awaiting Review2.3
  • Version 2.2.11.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
11 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

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.