#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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.3.2 |
| Component: | Media | Version: | 2.3.0 |
| Severity: | normal | 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
@
11 years ago
- Component Component - XProfile → API - Avatars
- Keywords has-patch added
- Milestone Awaiting Review → 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
@
11 years ago
- Milestone 2.3.2
- Resolution → worksforme
- Status assigned → closed
Yep, that did it!
Thanks :)
#4
@
11 years ago
- Keywords commit added
- Milestone → 2.3.2
- Resolution worksforme
- Status closed → reopened
Thanks for your confirmation, i'll commit the patch asap :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Ok thanks for your feedback i'll look at it asap.