Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Changing Avatar Cropping Ratio


Wythagy
Participant

@wythagy

I\’m assuming it is something in here that I need to change in addition to the avatar size values, I just haven\’t yet figured it out…

// Perform v1 crop

$v1_dest = apply_filters( ‘bp_avatar_v1_dest’, dirname($source) . ‘/’ . preg_replace(‘!(\.[^.]+)?$!’, $v1_filename . ‘$1’, basename($source), 1), $source );

if ( $from_signup )

$v1_out = wp_crop_image( $source, $v1_x1, $v1_y1, $v1_w, $v1_h, CORE_AVATAR_V1_W, CORE_AVATAR_V1_H, false, $v1_dest );

else

$v1_out = wp_crop_image( $source, ($v1_x1 * $multi), ($v1_y1 * $multi), ($v1_w * $multi), ($v1_h * $multi), CORE_AVATAR_V1_W, CORE_AVATAR_V1_H, false, $v1_dest );

// Perform v2 crop

if ( CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false ) {

$v2_dest = apply_filters( ‘bp_avatar_v2_dest’, dirname($source) . ‘/’ . preg_replace(‘!(\.[^.]+)?$!’, $v2_filename . ‘$1’, basename($source), 1), $source );

if ( $from_signup )

$v2_out = wp_crop_image( $source, $v2_x1, $v2_y1, $v2_w, $v2_h, CORE_AVATAR_V2_W, CORE_AVATAR_V2_H, false, $v2_dest );

else

$v2_out = wp_crop_image( $source, ($v2_x1 * $multi), ($v2_y1 * $multi), ($v2_w * $multi), ($v2_h * $multi), CORE_AVATAR_V2_W, CORE_AVATAR_V2_H, false, $v2_dest );

}

Skip to toolbar