[buddypress-trac] [BuddyPress Trac] #6479: jcrop aspect ratio isn't properly pulling in height/width constants from bp-custom.php

buddypress-trac noreply at wordpress.org
Thu Jun 4 18:58:13 UTC 2015


#6479: jcrop aspect ratio isn't properly pulling in height/width constants from
bp-custom.php
----------------------------------+-----------------------------
 Reporter:  studio625             |      Owner:
     Type:  defect (bug)          |     Status:  new
 Priority:  normal                |  Milestone:  Awaiting Review
Component:  Component - XProfile  |    Version:  2.3.0
 Severity:  normal                |   Keywords:
----------------------------------+-----------------------------
 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,
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6479>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list