Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can’t upload avatar image under 451px


  • DragoWeb
    Participant

    @dragoeco

    Hi, I have this error message

    “There was a problem cropping your profile photo.”

    when I try to upload an avatar image with a width of 450px and above. Starting to 451px it works (even with an height of 150px). I get a warning message only if I try to upload an image under 150x150px :

    “You have selected an image that is smaller than recommended. For best results, upload a picture larger than 150 x 150 pixels.”

    So, I suppose this problem doesn’t come from a setting option somewhere.

    The problem is the same when I switch to the default theme Twenty Fifteen and I have no other plugin activated (except HideMySite). Cover image works without problem. Cropping image works with Ultimate-member plugin and in WP admin -> Media -> Edit/crop as well.

    Config:
    Wordpress (new install) v4.9
    Buddypress 2.9.2
    php 5.6
    GD enabled

    Thanks.

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

  • DragoWeb
    Participant

    @dragoeco

    There is something really strange. When I define

    define( ‘BP_AVATAR_ORIGINAL_MAX_WIDTH’, 450 );

    to 150 (in /bp-core/bp-core-avatars.php line 35), instead of 450 originally, then I’m able to upload images from 151 of width. This must be the max-with but it behaves like a min-with. I continue my investigations…


    DragoWeb
    Participant

    @dragoeco

    I’ve installed a WP on local and it works. Then I’ve installed a WP on a test folder and the problem happens again. So I guess this is a server problem. PRobably the GD or imagemagick library.

    GD is enable (version bundled (2.1.0 compatible)) but I can’t find imagemagick in the phpinfo. I’m hosted by OVH and have no idea how to proceed to activate it. I will make some further searches on Google…


    DragoWeb
    Participant

    @dragoeco

    Ok, I found the problem. I had to swich from legacy to stable environment in my OVH admin section, then imagick is now enable. Hope this will help someone else 🙂


    DragoWeb
    Participant

    @dragoeco

    One more thing: Edit your .ovhconfig in the FTP’s root and change :

    environment=development

    into

    environment=production

    Then save and upload


    Boone Gorges
    Keymaster

    @boonebgorges

    Whoa, this is a pretty obscure problem. Thank you very much for following up with your solution.


    jesusinica
    Participant

    @jesusinica

    The error seems to be back, uploading any photo under 452px causes the issue.

    The solution suggested by @dragoeco seems to work:

    
    define( ‘BP_AVATAR_ORIGINAL_MAX_WIDTH’, 150 );
    
    

    My installation uses the docker image: wordpress:php7.4-fpm-alpine

    My environment:

    
    PHP: 7.4.13
    WordPress: 5.7.1
    BuddyPress: 7.3.0
    GD: bundled (2.1.0 compatible)
    Imagemagick:3.4.4
    
    

    Plugins enabled:

    
    BuddyPress: 7.3.0
    
    

    Theme:

    
    Twenty Twenty-One: 1.2
    
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar