Skip to:
Content
Pages
Categories
Search
Top
Bottom

Since update BP using 600 x 200 profile images


  • John
    Participant

    @jhob

    After updating to BP 2.9.4 and WP 4.9.5, every time a BP profile is updated the profile image that is used (in [bp_members] for example) is a resized 600 x 200 version.

    bp-custom.php has the following:

    define ( 'BP_AVATAR_THUMB_WIDTH', 86 );
    define ( 'BP_AVATAR_THUMB_HEIGHT', 50 );
    define ( 'BP_AVATAR_FULL_WIDTH', 1920 );
    define ( 'BP_AVATAR_FULL_HEIGHT', 1111 );
    define ( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 2000 );
    define ( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 );

    The photo URLs of affected profiles are in the form: https://staging.independenthostels.co.uk/wp-content/uploads/avatars/124/5a1457dc281d8-bpfull-600x200_c.jpg

    and for unaffected profiles they are of the form: https://staging.independenthostels.co.uk/wp-content/uploads/avatars/1230/577536f1c3382-bpfull.jpg

    The 600 x 200 image is newly created, it did not exist prior to the update.

    This is a site I’ve recently inherited and whilst I’m a very experienced WP dev I have not had many dealings with BuddyPress. I’ve checked everywhere that I could think of to see where the 600×200 resizing is happening but can’t for the life of me work it out.

    Does anyone have an idea of what’s going on here and how I might resolve it?

Viewing 2 replies - 1 through 2 (of 2 total)

  • Paul Wong-Gibbs
    Keymaster

    @djpaul

    What version did you update *from*?


    John
    Participant

    @jhob

    It was v2.9.3.

    I have just found that the previous developer had modified a core file:

    Line 603 in /bp-core/js/avatar.js (& avatar.min.js):

    
    // Add the cropping interface
    			tocrop.Jcrop( {
    				onChange: _.bind( self.showPreview, self ),
    				onSelect: _.bind( self.showPreview, self ),
    				// CUSTOM CODE START
    				// THIS ALSO NEEDS UPDATING ON 'avatar.min.js' !!! //
    				aspectRatio: 1.72817,
    				// CUSTOM CODE END
    				/* CUT SECTION
    				aspectRatio: self.options.aspectRatio,
    				*/
    				setSelect: [ crop_left, crop_top, crop_right, crop_bottom ]
    			}, function() {
    				// Get the Jcrop API
    				bp.Avatar.jcropapi = this;
    			} );
    

    I re-applied this modification to avatar.js and avatar.min.js but it did not resolve the issue.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar