#6479 closed defect (bug) (fixed)
jcrop aspect ratio isn't properly pulling in height/width constants from bp-custom.php
Reported by: | studio625 | Owned by: | imath |
---|---|---|---|
Milestone: | 2.3.2 | Priority: | normal |
Severity: | normal | Version: | 2.3.0 |
Component: | Media | Keywords: | has-patch commit |
Cc: |
Description
When I define a non-square aspect ratio in bp-custom.php, the jcrop interface doesn't correctly constrain the aspect ratio. If I hardcode it in, it works fine, so something is breaking down when BP hands it over to jcrop.
Here's my bp-custom code:
define ( 'BP_AVATAR_FULL_WIDTH', 328 ); define ( 'BP_AVATAR_FULL_HEIGHT', 437 );
Here's how I've been fixing it in BP < 2.3
Original Code (around line 223 of bp-core-cssjs.php:
aspectRatio: <?php echo (int) $aspect_ratio; ?>,
Modified Code:
aspectRatio: <?php echo $aspect_ratio; ?>,
(basically, don't cast it into an integer.
How I fixed it in BP 2.3
With the 2.3 release, the avatar cropping interface is different. I haven't figured out a solution other than hardcoding the aspect ratio into bp-core/js/avatar.js:
aspectRatio: 328 / 437,
Attachments (1)
Change History (9)
#2
@
9 years ago
- Component changed from Component - XProfile to API - Avatars
- Keywords has-patch added
- Milestone changed from Awaiting Review to 2.3.2
Ok it looks like i'm building the aspect ratio the wrong way. I think 6479.patch should fix the issue.
Can you confirm @studio625 ?
#3
@
9 years ago
- Milestone 2.3.2 deleted
- Resolution set to worksforme
- Status changed from assigned to closed
Yep, that did it!
Thanks :)
#4
@
9 years ago
- Keywords commit added
- Milestone set to 2.3.2
- Resolution worksforme deleted
- Status changed from closed to reopened
Thanks for your confirmation, i'll commit the patch asap :)
Ok thanks for your feedback i'll look at it asap.