BuddyDev

Search

[Resolved] reduce the maximum size avatar // gravatar

Tagged: 


  • Participant
    Level: Enlightened
    Posts: 125
    Hervé on #13680

    Hello,
    1 /
    I wanted to reduce the maximum size of the downloaded image to 400 KB
    Off I get this error message even with an image that has some ko
    “F4340.jpg exceeds the maximum download size of this site.”

    Is there any other place to make this limit?
    I looked until now https://codex.buddypress.org/getting-started/customizing/changing-internal-configuration-settings/

    define ( ‘BP_AVATAR_THUMB_WIDTH’, 80 );
    define ( ‘BP_AVATAR_THUMB_HEIGHT’, 80 );
    define ( ‘BP_AVATAR_FULL_WIDTH’, 150 );
    define ( ‘BP_AVATAR_FULL_HEIGHT’, 150 );
    define ( ‘BP_AVATAR_ORIGINAL_MAX_WIDTH’, 800 );
    //define ( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 400 );

    2 / on the other hand how to forbid the use of ravatar for some people who have a link with their email but iuamge is not acceptable for the site

    F4340.jpg excède la taille maximale de téléchargement de ce site.

    Regards


  • Keymaster
    (BuddyDev Team)
    Posts: 16362
    Brajesh Singh on #13681

    Hi Herve,
    here we go

    1. https://buddydev.com/buddypress/limit-buddypress-user-group-avatar-file-size/

    2. I suggest you either disable gravatar completely and use custom default avatars. Doing it for individual members is not worth the effort. If you still want it, use User switching plugin and change their avatar.

    Hope that helps.

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 125
    Hervé on #13682

    Hello Brajesh

    Thank you for this quick and efficient reply

    1 / works well in bp_custom (at the beginning I put it in functions.php and it did not work) but I do not understand why BP_AVATAR_ORIGINAL_MAX_FILESIZE does not work
    but with buddydev_limit_buddypress_avatar_file_size, would it be possible in addition! save the name of the nickname as filename (because during backups, files with very long names are not saved)

    2/ how to completely disable gravatar* ?

    Regards
    * * it’s a dating site so the photo is mandatory (with your plugin) and must be personalized


  • Keymaster
    (BuddyDev Team)
    Posts: 16362
    Brajesh Singh on #13683

    Hi Herve,
    1. I am sorry, Can you please clarify it again
    1. b. I don’t see an easy way for limiting the name.

    2. Please visit Dashboard->Settings->Discussion and you will see the option for the same.

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 125
    Hervé on #13684

    Hi Brajesh

    1/ The idea is to rename xxrSSDzsrO8iVK99FGzrDl72eJkfbmt4t8yenImKBV9ip2J1EIeUzA9paTSgKmv.jpg by nickname.jpg at the time of registration if it is possible?
    Maybe easier with
    https://screenshots.firefox.com/QtiR2YyHwPx4NKda/null
    https://screenshots.firefox.com/2m0HOHqkv9afntPZ/null

    2 / I tried to disable the checkbox gravatar. No more profile pictures are displayed on the site

    Regards


  • Keymaster
    (BuddyDev Team)
    Posts: 16362
    Brajesh Singh on #13695

    Hi Herve,

    1.
    a) First image is not part of BuddyPress and you can control it using a plugin like https://wordpress.org/plugins/file-renaming-on-upload/

    b) For the avatars, you may have control over the original filename using the above plugin. For the generated name, there is not much we can do

    2. We have a detailed post about this
    https://buddydev.com/buddypress/using-different-default-avatar-buddypress-users-based-profile-fields-member-type/

    and
    https://buddydev.com/buddypress/definitive-guide-buddypress-avatars/

    Hope that helps.

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 125
    Hervé on #13715

    Hi Brajesh

    Ok I hope it works but I have not seen the members who use gravatar.
    In addition I have to change the string of characters “If you use Gravatar with the email that you indicated during your registration, it will be displayed.” . Can I overload a single string or do I need to update the entire pot file?

    ok I got it wrong (ko instead of byte) for define ( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 400 );

    ok i’m looking a plugin to rename a file

    Thank you for these guides that I put in favorites in Firefox
    Hervé


  • Keymaster
    (BuddyDev Team)
    Posts: 16362
    Brajesh Singh on #13722

    Thank you Herve.

    I am glad you got it working.

    For the single string, you can translate only that string and generate the mo file. The mo file will only contain the particular string and will work fine.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved
Subscribe