Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Avatar Upload Issues


Mark Waterous
Participant

@delayedinsanity

Temporary fix? Open bp-core-avatars.php and around line 288 you should see the following:

$bp->avatar_admin->image->url = str_replace( WP_CONTENT_DIR, BP_AVATAR_URL, $bp->avatar_admin->image->dir );

Replace it with:

$bp->avatar_admin->image->url = str_replace( WP_CONTENT_DIR, BP_AVATAR_URL . ‘/wp-content’, $bp->avatar_admin->image->dir );

…this is presuming you’re having issues with image uploads on an MS site where you get as far as cropping without seeing an image. If you’re on an MS site and you can’t get that far because of an unknown error, (object of class WP_Error can not…) you first need to apply changeset 2124 (https://trac.buddypress.org/changeset/2124) just to see the proper error, then back to bp-core-avatars.php and find around line 266:

if ( getimagesize( $bp->avatar_admin->original ) > BP_AVATAR_ORIGINAL_MAX_WIDTH )
$bp->avatar_admin->resized = wp_create_thumbnail( $bp->avatar_admin->original, BP_AVATAR_ORIGINAL_MAX_WIDTH );

…and replace it with:

$orig_dimensions = getimagesize( $bp->avatar_admin->original );

/* Resize the image down to something manageable and then delete the original */
if ( $orig_dimensions[0] > BP_AVATAR_ORIGINAL_MAX_WIDTH || $orig_dimensions[1] > BP_AVATAR_ORIGINAL_MAX_WIDTH )
$bp->avatar_admin->resized = wp_create_thumbnail( $bp->avatar_admin->original, BP_AVATAR_ORIGINAL_MAX_WIDTH );

This is what I’ve done to fix the problem on my install of WP 3.0 and BuddyPress 1.2.3, your mileage may vary.

Skip to toolbar