Skip to:
Content
Pages
Categories
Search
Top
Bottom

avatar cropping: after upload, image and cropper don\'t appear, fails


  • rickbradford
    Member

    @rickbradford

    Hello, all. I’ve having trouble uploading avatars for members (haven’t tried groups). I’ve looked around the forums but haven’t found a thread for this specific issue.

    What happens is I can choose the image, it seems to upload and I get the crop screen. Except the image is blank and there are no graphics for the cropper tool. If I click the crop button I get an error message: “There was a problem cropping your avatar, please try uploading it again”

    So what I see is basically this:

    Crop Your New Avatar

    Avatar to cropAvatar preview

    Below it is an avatar-sized space with no image and below that is the “Crop Image” button.

    1. In BP settings “Disable avatar uploads?” is checked no.

    2. I can upload images to Media.

    3. Identicons work.

    4. I’ve got three active plugins. I deactivated them one by one to try uploading an avatar and it didn’t make any difference. Jquery (the conflicting plugin in another thread) is not one of them.

    5. Right-clicking in the blank space suggests the image isn’t there at all (no image-related options).

    WP 2.9.2

    BP 1.2.2.1

    Firefox 3.6 (prior/after an update installed today), Opera 10.10

    BuddyPress Widget Theme 1.2

    I’m missing something, right?

Viewing 25 replies - 26 through 50 (of 52 total)
  • This worked a treat for me!

    If you need to find your “Full URL path to files” you can find your DOCUMENT_ROOT by using phpinfo(); and adding “wp-content/uploads” to the end.

    e.g:
    Store uploads in this folder “wp-content/uploads”
    Full URL path to files “/home/ACCOUNT/public_html/wp-content/uploads”

    How can I create a phpinfo.php page? Try this link:
    http://kb.mediatemple.net/questions/764/How+can+I+create+a+phpinfo.php+page%3F

    Be aware that copying the code directly from @gian-ava will copy the wrong type of single quotes as @shaista points out above.

    To check that your image is being uploaded take a look in /public_html/wp-content/uploads/group-avatars on your server


    nessradio
    Participant

    @nessradio

    I’ve got a similar problem and I tried all the solution present in this topic but none of them worked…

    Please have a look to my Topic to help me:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/impossible-to-upload-image-on-change-avatar-and-album-upload-picture-and-cant-send-private-message/#post-54071

    Thx All


    Psyber
    Participant

    @psyber

    I have the same issue, although I haven’t attempted a code fix yet. I am running a custom child theme with BP 1.2.3.

    @nessradio and @psyber I am repeating all steps gain in detail mentioned by @gian-ava

    Go to admin side of your blog then click from left menu Settings -> Miscellaneous Settings
    Set “Store uploads in this folder” to “wp-content/uploads”.
    Set “Full URL path to files” to the REAL FULL PATH of your uploads. e.g “http://yoursiteblog/wp-content/uploads”

    Go to wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
    Then change bp-core-avatars.php line 389

    Replace:
    if ( !$path = get_option( ‘upload_path’ ) )
    $path = WP_CONTENT_DIR . ‘/uploads’;

    With:
    if ( !$path = get_option( ‘upload_path’ ) )
    $path = WP_CONTENT_DIR . ‘/uploads’;
    else $path = ABSPATH . $path;

    Note: Take care for quotes you must remove and again add by yourself, otherwise you will get Warning: Division by zero …
    Hope it will work perfectly for image upload and crop issue.


    Psyber
    Participant

    @psyber

    Go to admin side of your blog then click from left menu Settings -> Miscellaneous Settings — I don’t think this menu is available in WordPress MU, am I missing something?


    nessradio
    Participant

    @nessradio

    So in my case I find the problem of why “upload avatar” doesn’t work.
    It’s because of the BuddyPress Template pack plugin. When I use the bp default theme everything works perfectly.
    When I use any wordpress theme that I made compatible with BuddyPress using the plugin bp Template pack I find exactly the same problem: Avatar Upload, private message, register… all of that doesn’t work… as soon as you click on the button “Submit” or “Crop” you go back to the same page and nothing happen?! It’s like the information wasn’t given at all…
    There is a conflict somewhere that I can’t find!
    Any Ideas???

    [EDIT] Ok I solved the problem!!!
    Ok so if none of the solution you have in this topic works for you it’s probably because you have a conflict between a js script in your default theme and a js script in your wordpress theme… take a minute tu disable all the js action in your wordpress theme ton test if it’s coming from there…

    Hi Folks,

    For those of you who are getting the “Warning: Division by zero in….” message when you change the code at bp-core-avatars.php line 389: The single quotations did not copy/paste correctly. After you paste in the new code, be sure to replace the four single quotations (two on line one, two on line two) with the single quote key on your keyboard. Easy fix!

    Have fun.


    Psyber
    Participant

    @psyber

    How do we fix this issue for WPMU installations?


    thenone
    Participant

    @thenone

    david: “~ you may try “Settings” >> “Miscellaneous” Clear “Store uploads in this folder”-path” your suggestion is working

    thanks


    Psyber
    Participant

    @psyber

    How do we fix this issue for WPMU installations?


    Psyber
    Participant

    @psyber

    Has anybody had this issue on a WPMU installation and found a way to fix it?


    Psyber
    Participant

    @psyber

    What could be causing this issue, I haven’t been able to find a fix for my website, I’m starting to think my users think I am a joke for an admin because this issue has persists for about 2 weeks now. Has anybody had this issue on a WPMU installation and found a way to fix it?


    gregfielding
    Participant

    @gregfielding

    You’re not alone…I’m on BP 1.2.3 and MU 2.9.2 with a custom child theme and avatar cropping stopped working for me sometime in the last couple of weeks. I assumed it was a plugin conflict, but I’ve disabled them one-by-one and retried with no luck.


    Sumo Fighter
    Participant

    @sumofighter

    Same here. No avatar and no avatar cropping. The “Settings” >> “Miscellaneous” fix broke my wp-gallery. In the new bp-core-avatars.php (BP 1.2.4) the function “if ( !$path = get_option( ‘upload_path’ ) )/$path = WP_CONTENT_DIR . ‘/uploads’;” has been deprecate. I’m lost here. :-S


    Hans
    Participant

    @hanss

    I’m joining the club! It still doesn’t work on WP 2.9.2 and BP 1.2.4. for me.


    Psyber
    Participant

    @psyber

    I see lots of tickets for this issue, and it seems to be apparent in almost all configurations of WP/WPMU & Buddypress.


    Psyber
    Participant

    @psyber

    This one is for the forum mods, have you experienced this issue and found a way to fix it? I wish someone would suggest a fix, or make sure it gets fixed for good with the next update. This feature has to be used by every member of every BP site.


    somethingelse
    Participant

    @somethingelse

    This bit of code:

    “Go to wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
    Then change bp-core-avatars.php line 389

    Replace:
    if ( !$path = get_option( ‘upload_path’ ) )
    $path = WP_CONTENT_DIR . ‘/uploads’;

    DOES NOT APPEAR in my copy of bp-core-avatars.php

    nor is there anything remotely similar…
    i JUST installed BP yesterday (v1.2.4.1) into an existing WP install (v2.9.2) so everything is up to date
    i’m using the bp-themepack on magazine-basic theme

    any thoughts??
    i ALSO did a new install of WP & BP (same versions but installed at the same time) on a different site and the crop tool works perfectly.
    both sites are on the same server with the same configurations.


    Ty
    Participant

    @tikrin

    It seems v1.2.4.1 has removed that piece of code. So far, out of scouring the internet for almost a week, I still have seen no type of help or aid in this. A few people have pointed to plugins interfering with the crop functionality but the only plugins I currently have are BP, and the BP Template Pack. I’m still trying to discover a fix myself but would greatly appreciate it if someone a little more code savvy has stumbled upon the fix.

    It seems to revolve around jCrop not being a function. However, I inserted the function straight into the page but still can not get it to recognize as a function, which is quite interesting.


    Ty
    Participant

    @tikrin

    I was able to fix mine finally. While it may not be a conflicting plugin, it is quite possible that the theme you are using is calling its own scripts in away that makes the DOM skip BP’s loading of jCrop. (I could be way off and may not even be using the terms correctly. In the end, jCrop was inserting into the source code but it seemed like it would be after everything else had ran.) In my case, I looked into my theme’s folder, and found that it had its own “includes” folder. Inside this folder was a “scripts.php” function. From there, I read where it was pulling its scripts from. I then dropped the jCrop into the directory that it was looking into, and inserted the code to load up jCrop. It fixed it. I know this won’t work for you probably, but I hope that I was able to explain it enough of a way that you will be able to find and fix it similar to my example.

    Hopefully this will somehow get fixed in the next update, but who knows how long it will take?

    Good luck, and I wish I could give a more cookiecutter way of fixing it.


    nanchante
    Participant

    @nanchante

    for me, it was the facebook footer bar that was conflicting…..


    CR
    Participant

    @creay

    I posted this in another thread on the topic, but I thought I would post it here too in case it helps anyone. I don’t know if this was anyone else’s issue, but this was my problem and the solution I found.

    SET UP: Running BuddyPress on a single install (not MU) and using the default BuddyPress theme with an assortment of plugins (but removing all the plugins did not help my problem).

    PROBLEM: jcrop function wouldn’t work after an avatar was uploaded either on the registration or edit avatar pages within buddypress. The image and thumbnail would show, but there was no crop box to change what was selected for the thumbnail. Very frustrating.

    SOLUTION: stupidly simple once I finally found it – for some reason there was no link to the external jcrop javascript file appearing in the header of the pages! (This can be checked by viewing the page source of the problem pages via your browser) To fix this I edited the bp-core-cssjs.php file which is inside the bp-core folder inside buddypress. Right after this line:

    `$aspect_ratio = (int) constant( ‘BP_AVATAR_FULL_WIDTH’ ) / (int) constant( ‘BP_AVATAR_FULL_HEIGHT’ ); ?>`

    I added:

    `<script src="/wp-includes/js/jcrop/jquery.Jcrop.js”>`

    And now the crop tool is showing up and everything works perfectly! Note that you may need to change the path to the Jcrop.js file depending on your site setup. Before this I had also downloaded the latest version of jcrop from http://deepliquid.com/content/Jcrop.html and updated it on my site, so I don’t know if that plays in at all or not.

    Again, don’t know if that helps anyone else, it might have been something quirky in my set up maybe, but it did the trick for me so I figured I’d share it just in case.


    djinni
    Member

    @djinnworld

    I just registered to say this: @creay one million THX!!

    Hey everyone. I am having the same problem. I have tried most everything… but i am sure it has something to do with the jcrop function being disabled by the theme i am working from. Can someone please HELP ME?!? it is driving me crazy. The site is http://www.ningbotoday.com&#8230; and so far i have enacted most of the solutions in this topic. For the most recent… my bp-core-cssjs.php file has the following line..
    // Calculate Aspect Ratio
    if ( (int) constant( ‘BP_AVATAR_FULL_HEIGHT’ ) && ( (int) constant( ‘BP_AVATAR_FULL_WIDTH’ ) != (int) constant( ‘BP_AVATAR_FULL_HEIGHT’ ) ) )
    $aspect_ratio = (int) constant( ‘BP_AVATAR_FULL_WIDTH’ ) / (int) constant( ‘BP_AVATAR_FULL_HEIGHT’ );
    ?>
    So i add the line as you say, and i get nothing. I have also changed the upload directory to the specific directory, and no love there either. I want to get thru this so i can attend to the rest of the slew of projects i have lined up for this site. Can anyone help?

    ooh.. and to add… i used the plugin “user-avatar” and the crop from the dashboard profile works fine.. so i know it has something to do with my themes expression of the code…

Viewing 25 replies - 26 through 50 (of 52 total)
  • The topic ‘avatar cropping: after upload, image and cropper don\'t appear, fails’ is closed to new replies.
Skip to toolbar