Looking for remote work in tech?
Download our app Apple App Store Google Play Store
Looking for remote work in tech? Download our mobile app now! Apple App Store Google Play Store

Fixing Aspect Ratio Issue with BuddyPress Avatar


 

November 7, 2012 | By: Adrian

A recent issue we had was with the interface to edit an avatar profile image in BuddyPress. It was locking in an aspect ratio and that was limiting the users.

Here’s a solution to get rid of that aspect ratio lock.

Note: This is not the best solution as your modifying the core (something we don’t do) but BuddyPress leaves us no option.

Browse to: /wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php

Go to line 62 and comment out the aspectRatio property:

jQuery('#avatar-to-crop').Jcrop({
onChange: showPreview,
onSelect: showPreview,
onSelect: updateCoords,
// aspectRatio: <?php echo $aspect_ratio ?>, */
setSelect: [ 0, 0, <?php echo $full_width?>, <?php echo $full_height?> ]
});