Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Avatar Sizes/ Presets for Avatar Cropping

  • Avatar of zeitweise
    zeitweise
    Participant

    @zeitweise

    I would like to change the sizes of the avatars so they will not be squared but oblonged. Does anyone know where to change the presets for avatar cropping?

    Is it even possible with the current cropping mechanism?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of Mariusooms
    Mariusooms
    Participant

    @mariusooms

    Take a look at the first few lines of file bp-core-avatars.php in the plugins/buddypress/bp-core directory.

    /* Define settings for avatars. [TODO] This will eventually end up as admin configurable settings */
    define( 'CORE_AVATAR_V1_W', apply_filters( 'bp_core_avatar_v1_w', 50 ) );
    define( 'CORE_AVATAR_V1_H', apply_filters( 'bp_core_avatar_v1_h', 50 ) );
    define( 'CORE_AVATAR_V2_W', apply_filters( 'bp_core_avatar_v2_w', 150 ) );
    define( 'CORE_AVATAR_V2_H', apply_filters( 'bp_core_avatar_v2_h', 150 ) );

    Currently they are not admin configurable yet, so keep not of the changes you make.

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Changing these settings will also not go back and change any existing avatars, so it’s best to set this one time and forget about it (until you update later.)

    I recommend copy and pasting those define’s into a bp-custom.php file so that way BuddyPress upgrades won’t reset those values for you.

    Avatar of zeitweise
    zeitweise
    Participant

    @zeitweise

    Thank you!

    Avatar of Samantha Miller.
    Samantha Miller.
    Participant

    @samantha-miller

    Thanks for pointing me in the right direction @mariusooms and @johnjamesjacoby. As this is an old topic but came up first on Google, I thought I’d update with the current syntax:

    `define( ‘BP_AVATAR_THUMB_WIDTH’, 50 );
    define( ‘BP_AVATAR_THUMB_HEIGHT’, 50 );
    define( ‘BP_AVATAR_FULL_WIDTH’, 150 );
    define( ‘BP_AVATAR_FULL_HEIGHT’, 150 );`

    This is using BP version 1.6.4.

    Cheers!

    Avatar of WeirdMike
    WeirdMike
    Participant

    @splendidangst

    You’re awesome for the update @samantha-miller

    Avatar of Samantha Miller.
    Samantha Miller.
    Participant

    @samantha-miller

    @splendidangst No problem :)

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

You must be logged in to reply to this topic.