Thank you Max.
The problem is the aspect ratio
It should not be zero.
Is your theme defining custom height/width for avatar? I just checked the BuddyPress code in ‘bp_core_Add_cropper_inline_js’ and the ratio is calculated by this
$aspect_ratio = $full_width / $full_height;
It is later type casted to integer. So, if the theme defines width less than height, It gets set to zero.
I hope it clarifies.
Now I checked the Member profile page and changing the avatar, where crop ratio is working correct.
<link rel='stylesheet' id='jcrop-css' href='https://dev.abodva.com/wp-includes/js/jcrop/jquery.Jcrop.min.css?ver=0.9.12' type='text/css' media='all' />
Maybe it can help to understand the problem.
Theme theme doesn’t use square avatar.
Even though both the section are handled by BuddyPress, Profile avatar uses different code for showing the cropper.
If you want, you can fix it by editing buddypress/bp-core/bp-core-cssjs.php and changing oine 291 from
aspectRatio: <?php echo (int) $aspect_ratio; ?>,
aspectRatio: <?php echo $aspect_ratio; ?>,
The bug lies in the legacy code.
That’s the problem. It is hardcoded and the only way to do is to completely rewrite the whole “bp_core_add_cropper_inline_js” function. It does not seem justified for a minor change like this. I will rather open a topic on BuddyPress trac and see if they can add it as an enhancement in future version.
You must be logged in to reply to this topic.