Thank you Max.
The problem is the aspect ratio
It should not be zero.aspectRatio: 0,
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.
Regards
BrajeshThank you.
Now I checked the Member profile page and changing the avatar, where crop ratio is working correct.
<script type='text/javascript' src='https://dev.abodva.com/wp-includes/js/jcrop/jquery.Jcrop.min.js?ver=0.9.12'></script>
<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.Hi Max,
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; ?>,
to
aspectRatio: <?php echo $aspect_ratio; ?>,
The bug lies in the legacy code.
Regards
BrajeshThank you.
Could you help to write this code as snippet not to overwrite after updating?
I use Snippet plugin for wordpress.
Regards,
MaxHi Max,
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.Regards
BrajeshSubscribing to this thread, Im hoping to see good things come of it.
Hello, Brajesh
Could you, please, check the avatar and avatar previes size in mobile view?
Now, it’s not responsive.
Thank you.
Hi Max,
I am sorry but I am not controlling the avatar size. The theme is using custom avatar size of 350×4350 and that’s why you are seeing it.I am unable to help with and you will need to ask the theme developer for the support.
Regards
Brajesh.
You must be logged in to reply to this topic.