Skip to:
Content
Pages
Categories
Search
Top
Bottom

Avatar Upload Issues

  • @johnjamesjacoby

    Keymaster

    There are numerous tickets in the trac and topics in the forums popping up. It seems lots of users are having issues uploading avatars with 1.1.2.

    I’ve tested this on two different environments with subdomains and subdirectory installs and cannot duplicate the problem myself. However, we’re aware that it’s an issue and will keep trying to resolve it.

    In the meantime, please route your avatar upload related discussion here. It will help us better monitor everyone’s experiences. Other topics regarding this issue will be locked and linked to this topic until it is resolved.

    Thanks everyone for being awesome and patient and understanding. :thumbup:

Viewing 25 replies - 76 through 100 (of 111 total)
  • @mike3ike

    Participant

    @ipstenu

    I’ve read some of your posts about the sizing issue. The size doesn’t seem to effect my install. Just tried a 280×187, 420×280, same error with both group and individual avatars.

    @chadmaifithcom

    Participant

    Mike, do you get the images to display at all in the cropper? I can get to the cropper now then it conks out I hit the crop this image then it says that the image cannot be uploaded.

    This is getting very frustrating!

    @chadmaifithcom

    Participant

    ipstenu, it doesn’t seem to matter whether or not I upload square images, I just cant get past that one part where it needs to actually crop and upload the two sizes.

    @chadmaifithcom

    Participant

    Call to undefined function ms_file_constants() in /home/utwebdev/public_html/wp-includes/ms-files.php on line 14

    I am seeing this in the error logs. Going to look into it.

    @phlux0r

    Participant

    For avatar upload issues concerning size and if you’re getting the message: Cannot convert object of type WP_Error into string (or similar) see my post here: https://buddypress.org/forums/topic/avatar-upload-issue-1#post-50231

    Maybe this will help some of you.

    @chadmaifithcom

    Participant

    Unfortunately not. I assume you also commented out the lines ->
    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 );

    @chadmaifithcom

    Participant

    OK, so it’s not just me. Try uploading an avatar to THIS SITE. You get the same issues I had! Jesus, hallelujah!

    @mike3ike

    Participant

    @Phlux0r added your code and it’s now working for me. Thanks!

    @Chad I wasn’t getting the image cropper before I added the code. Now getting the cropper and a successful upload with no errors.

    @chadmaifithcom

    Participant

    @Mike Henderson

    Did you comment out those two lines like I said?

    @mike3ike

    Participant

    Here is the code with more before or after:


    /* Move the file to the correct upload location. */
    if ( !empty( $bp->avatar_admin->original ) ) {
    bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original ), 'error' );
    return false;
    }

    /* Resize the image down to something manageable and then delete the original */
    /* HACK made some changes to check image parameters more carefully */
    $_size = getimagesize( $bp->avatar_admin->original );
    if ( $_size[0] > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {
    $_thumb = wp_create_thumbnail( $bp->avatar_admin->original, BP_AVATAR_ORIGINAL_MAX_WIDTH );
    // Need to check if upload succeeded - issue with small files!
    if ( is_object($_thumb) && get_class($_thumb) == 'WP_Error' ) {
    bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $_thumb->get_error_message()), 'error');
    return false;
    }
    $bp->avatar_admin->resized = $_thumb;
    }

    $bp->avatar_admin->image = new stdClass;

    /* We only want to handle one image after resize. */
    if ( empty( $bp->avatar_admin->resized ) )
    $bp->avatar_admin->image->dir = $bp->avatar_admin->original;
    else {
    $bp->avatar_admin->image->dir = $bp->avatar_admin->resized;
    @unlink( $bp->avatar_admin->original );
    }

    /* Set the url value for the image */
    $bp->avatar_admin->image->url = str_replace( WP_CONTENT_DIR, BP_AVATAR_URL, $bp->avatar_admin->image->dir );

    return true;
    }

    @ipstenu

    Participant

    @mike2ike – Until they sort out why code is getting eaten, maybe post the code to http://buddypress.pastebin.com/ ?

    @mike3ike

    Participant

    Seems to be showing for me. Went ahead and made a pastebin though: http://buddypress.pastebin.com/NZKUck7F

    @chadmaifithcom

    Participant

    Still nada. All changes made to my site in all places. I also had to change this :

    $bp->avatar_admin->image->url = str_replace( “/home/utwebdev/public_html/”, “http://utwebdev.utoronto.ca/”, $bp->avatar_admin->image->dir );

    or the thumbnails didn’t work. But that shouldn’t affect the uploads.

    @okso

    Participant

    hi all, I’ve read and re read every post and applied all fixes and I still I can’t get the return url right eg. http://roomontheedge.com/uploads/group-avatars/3/avatar15016.jpg somewhere wp-content is missing from the url thats set up to do the cropping stage. Any help really appreciated. d

    @chadmaifithcom

    Participant

    Oddly enough, when I go to view my Avatars at their respective URLs, nothing shows and the document returns 0 bytes — HOWEVER when I look using FTP and download the file, it is there and shows properly.

    For instance, if no file was found, this URL would return a 404 error and all I get is a blank page. But the image is there in the directory and the file is 33.2Kb.

    http://utwebdev.utoronto.ca/files/avatars/1/chad-bpfull.jpg

    Crazy huh!?

    @nightlygigs

    Member

    @Chad – I’m right there with you, buddy. I’ve added the code that @Phlux0r provided, both to my child theme and the actual buddypress theme. I’ve disabled all other plugins, tested on multiple browsers, and had other people try from their computers. Nobody can successfully change their avatar on my site. But the files are being uploaded, as they are visible via my FTP client. The image just never appears in the cropping stage.

    Here is the link to my site, which hasn’t gone live yet: http://outgoinggames.com/

    @chadmaifithcom

    Participant

    WIERD! I took out the file upload URL and media directory and it all started to work. Magically. Now … I’ve been messing with numerous files for the past week as you can see from my activity, but it all came together this morning when I cleared those fields.

    @helpme1

    Participant

    hello help. I can’t change my avatar!!!

    @daniel2008

    Member

    I can’t change my avatar,2

    @daniel2008

    Member

    ok

    @daniel2008

    Member

    tkanks

    @jason01111

    Participant

    Hi, im not sure if people have tried testing on different hosts with different results??

    2 hosts one works one doesn’t- its so weird, is this a godaddy problem?

    working: http://www.intelioum.com/buddypress/members/ (see there is a avatar there)

    not working: http://eyemagine.info/buddypress/

    user and pass for eyemagine(feel free to check it out): u: tester p: 123456

    you successfully sign in, it asks for you to upload a pic but later it just stalls and goes blank.

    what i noticed is that on my server the images are uploaded although the crop function ect never works.

    Would be great if someone has a fix- please let me know

    @delayedinsanity

    Participant

    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.

    @delayedinsanity

    Participant

    PS: I read page one, and this page of the thread, so if anybody else has already pointed out the above, oops!

    Apparently I posted too soon… Instead of editing the first item on line 288, the constant itself should be updated on line 17 of bp-core-avatars.php so that it looks like the following;

    define( ‘BP_AVATAR_URL’, bp_core_avatar_url() . ‘/wp-content’ );

    @jcollier

    Participant

    mwaterous’ solution did not work for me:

    Line 17 – define( ‘BP_AVATAR_URL’, bp_core_avatar_url() . ‘/wp-content’ );

    However, this did.

    https://buddypress.org/community/groups/miscellaneous/forum/topic/buddypress-and-wordpress-30/?topic_page=3#post-53045

    I replaced the entire bp-core-avatars file with the one mentioned by Edward Caissie from trac:

    https://trac.buddypress.org/browser/branches/1.2/bp-core/bp-core-avatars.php?rev=2957

    Works great with 2.9.2 and 1.2.3.

    Thanks!

Viewing 25 replies - 76 through 100 (of 111 total)
  • The topic ‘Avatar Upload Issues’ is closed to new replies.
Skip to toolbar