Skip to:
Content

BuddyPress.org

Ticket #970: avatar-size-resize-aspect-ratio.patch

File avatar-size-resize-aspect-ratio.patch, 19.3 KB (added by johnjamesjacoby, 17 years ago)
  • bp-core/bp-core-avatars.php

     
    3131
    3232if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
    3333        define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-xprofile/images/none-thumbnail.gif' );
    34        
     34
     35// Allow filtering of full avatar sizes
     36function bp_core_avatar_full_height() {
     37        echo bp_get_core_avatar_full_height();
     38}
     39        function bp_get_core_avatar_full_height() {
     40                return apply_filters( 'bp_get_core_avatar_full_height', BP_AVATAR_FULL_HEIGHT );
     41        }
     42
     43function bp_core_avatar_full_width() {
     44        echo bp_get_core_avatar_full_width();
     45}
     46        function bp_get_core_avatar_full_width() {
     47                return apply_filters( 'bp_get_core_avatar_full_width', BP_AVATAR_FULL_WIDTH );
     48        }
     49
     50// Allow filtering of thumb avatar sizes
     51function bp_core_avatar_thumb_height() {
     52        echo bp_get_core_avatar_thumb_height();
     53}
     54        function bp_get_core_avatar_thumb_height() {
     55                return apply_filters( 'bp_get_core_avatar_thumb_height', BP_AVATAR_THUMB_HEIGHT );
     56        }
     57
     58function bp_core_avatar_thumb_width() {
     59        echo bp_get_core_avatar_thumb_width();
     60}
     61        function bp_get_core_avatar_thumb_width() {
     62                return apply_filters( 'bp_get_core_avatar_thumb_width', BP_AVATAR_THUMB_WIDTH );
     63        }
     64
    3565function bp_core_fetch_avatar( $args = '' ) {
    3666        global $bp, $current_blog;
    37        
     67
    3868        $defaults = array(
    3969                'item_id' => false,
    4070                'object' => 'user', // user OR group OR blog OR custom type (if you use filters)
    4171                'type' => 'thumb',
    4272                'avatar_dir' => false,
    43                 'width' => false, 
     73                'width' => false,
    4474                'height' => false,
    4575                'class' => 'avatar',
    4676                'css_id' => false,
     
    4979        );
    5080
    5181        $params = wp_parse_args( $args, $defaults );
    52         extract( $params, EXTR_SKIP ); 
    53                
     82        extract( $params, EXTR_SKIP );
     83
    5484        if ( !$item_id ) {
    5585                if ( 'user' == $object )
    5686                        $item_id = $bp->displayed_user->id;
     
    5888                        $item_id = $bp->groups->current_group->id;
    5989                else if ( 'blog' == $object )
    6090                        $item_id = $current_blog->id;
    61                        
     91
    6292                $item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
    63        
     93
    6494                if ( !$item_id ) return false;
    6595        }
    66                
     96
    6797        if ( !$avatar_dir ) {
    6898                if ( 'user' == $object )
    6999                        $avatar_dir = 'avatars';
     
    71101                        $avatar_dir = 'group-avatars';
    72102                else if ( 'blog' == $object )
    73103                        $avatar_dir = 'blog-avatars';
    74                        
     104
    75105                $avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
    76                
    77                 if ( !$avatar_dir ) return false;               
     106
     107                if ( !$avatar_dir ) return false;
    78108        }
    79        
     109
    80110        if ( !$css_id )
    81                 $css_id = $object . '-' . $item_id . '-avatar'; 
    82        
     111                $css_id = $object . '-' . $item_id . '-avatar';
     112
    83113        if ( $width )
    84114                $html_width = " width='{$width}'";
    85115        else
    86                 $html_width = ( 'thumb' == $type ) ? ' width="' . BP_AVATAR_THUMB_WIDTH . '"' : ' width="' . BP_AVATAR_FULL_WIDTH . '"';
    87                
     116                $html_width = ( 'thumb' == $type ) ? ' width="' . bp_get_core_avatar_thumb_width() . '"' : ' width="' . bp_get_core_avatar_full_width() . '"';
     117
    88118        if ( $height )
    89119                $html_height = " height='{$height}'";
    90120        else
    91                 $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"';
    92        
    93         $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', $bp->root_domain . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );       
    94         $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );   
    95        
    96         /* If no avatars have been uploaded for this item, display a gravatar */       
     121                $html_height = ( 'thumb' == $type ) ? ' height="' . bp_get_core_avatar_thumb_height() . '"' : ' height="' . bp_get_core_avatar_full_height() . '"';
     122
     123        $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', $bp->root_domain . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     124        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     125
     126        /* If no avatars have been uploaded for this item, display a gravatar */
    97127        if ( !file_exists( $avatar_folder_dir ) && !$no_grav ) {
    98                
     128
    99129                if ( empty( $bp->grav_default->{$object} ) )
    100130                        $default_grav = 'wavatar';
    101131                else if ( 'mystery' == $bp->grav_default->{$object} )
     
    104134                        $default_grav = $bp->grav_default->{$object};
    105135
    106136                if ( $width ) $grav_size = $width;
    107                 else if ( 'full' == $type ) $grav_size = BP_AVATAR_FULL_WIDTH;
    108                 else if ( 'thumb' == $type ) $grav_size = BP_AVATAR_THUMB_WIDTH;
    109                
     137                else if ( 'full' == $type ) $grav_size = bp_get_core_avatar_full_width();
     138                else if ( 'thumb' == $type ) $grav_size = bp_get_core_avatar_thumb_width();
     139
    110140                if ( 'user' == $object ) {
    111141                        $ud = get_userdata( $item_id );
    112142                        $grav_email = $ud->user_email;
    113143                } else if ( 'group' == $object || 'blog' == $object ) {
    114144                        $grav_email = "{$item_id}-{$object}@{$bp->root_domain}";
    115145                }
    116        
    117                 $grav_email = apply_filters( 'bp_core_gravatar_email', $grav_email, $item_id, $object );       
     146
     147                $grav_email = apply_filters( 'bp_core_gravatar_email', $grav_email, $item_id, $object );
    118148                $gravatar = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' ) . md5( $grav_email ) . '?d=' . $default_grav . '&s=' . $grav_size;
    119                
     149
    120150                return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
    121151        } else if ( !file_exists( $avatar_folder_dir ) && $no_grav )
    122152                return false;
    123        
     153
    124154        /* Set the file names to search for to select the full size or thumbnail image. */
    125         $avatar_name = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';   
    126         $legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1';       
    127         $legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';   
    128        
     155        $avatar_name = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';
     156        $legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
     157        $legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';
     158
    129159        if ( $av_dir = opendir( $avatar_folder_dir ) ) {
    130160            while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
    131161                        if ( preg_match( "/{$avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) )
     
    134164        }
    135165    closedir($av_dir);
    136166
    137         return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params ); 
     167        return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
    138168}
    139169
    140170function bp_core_delete_existing_avatar( $args = '' ) {
    141171        global $bp;
    142        
     172
    143173        $defaults = array(
    144174                'item_id' => false,
    145175                'object' => 'user', // user OR group OR blog OR custom type (if you use filters)
     
    147177        );
    148178
    149179        $args = wp_parse_args( $args, $defaults );
    150         extract( $args, EXTR_SKIP );   
    151        
     180        extract( $args, EXTR_SKIP );
     181
    152182        if ( !$item_id ) {
    153183                if ( 'user' == $object )
    154184                        $item_id = $bp->displayed_user->id;
     
    156186                        $item_id = $bp->groups->current_group->id;
    157187                else if ( 'blog' == $object )
    158188                        $item_id = $current_blog->id;
    159                        
     189
    160190                $item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
    161        
     191
    162192                if ( !$item_id ) return false;
    163193        }
    164                
     194
    165195        if ( !$avatar_dir ) {
    166196                if ( 'user' == $object )
    167197                        $avatar_dir = 'avatars';
     
    169199                        $avatar_dir = 'group-avatars';
    170200                else if ( 'blog' == $object )
    171201                        $avatar_dir = 'blog-avatars';
    172                        
     202
    173203                $avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
    174                
    175                 if ( !$avatar_dir ) return false;               
     204
     205                if ( !$avatar_dir ) return false;
    176206        }
    177207
    178208        if ( 'user' == $object ) {
     
    183213                delete_usermeta( $item_id, 'bp_core_avatar_v2' );
    184214        }
    185215
    186         $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );   
     216        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    187217
    188218        if ( !file_exists( $avatar_folder_dir ) )
    189219                return false;
     
    191221        if ( $av_dir = opendir( $avatar_folder_dir ) ) {
    192222            while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
    193223                        if ( ( preg_match( "/-bpfull/", $avatar_file ) || preg_match( "/-bpthumb/", $avatar_file ) ) && '.' != $avatar_file && '..' != $avatar_file )
    194                                 @unlink( $avatar_folder_dir . '/' . $avatar_file );                             
     224                                @unlink( $avatar_folder_dir . '/' . $avatar_file );
    195225                }
    196226        }
    197227    closedir($av_dir);
     
    205235
    206236function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
    207237        global $bp;
    208        
     238
    209239        require_once( ABSPATH . '/wp-admin/includes/image.php' );
    210240        require_once( ABSPATH . '/wp-admin/includes/file.php' );
    211        
     241
    212242        $uploadErrors = array(
    213         0 => __("There is no error, the file uploaded with success", 'buddypress'), 
    214         1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE), 
     243        0 => __("There is no error, the file uploaded with success", 'buddypress'),
     244        1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
    215245        2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
    216246        3 => __("The uploaded file was only partially uploaded", 'buddypress'),
    217247        4 => __("No file was uploaded", 'buddypress'),
     
    222252                bp_core_add_message( sprintf( __( 'Your upload failed, please try again. Error was: %s', 'buddypress' ), $uploadErrors[$file['file']['error']] ), 'error' );
    223253                return false;
    224254        }
    225        
     255
    226256        if ( !bp_core_check_avatar_size( $file ) ) {
    227257                bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE) ), 'error' );
    228258                return false;
    229259        }
    230        
     260
    231261        if ( !bp_core_check_avatar_type( $file ) ) {
    232262                bp_core_add_message( __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress' ), 'error' );
    233263                return false;
    234264        }
    235        
     265
    236266        // Filter the upload location
    237267        add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
    238        
     268
    239269        $bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
    240270
    241271        // Move the file to the correct upload location.
     
    243273                bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
    244274                return false;
    245275        }
    246                
     276
    247277        // Resize the image down to something manageable and then delete the original
    248278        if ( getimagesize( $bp->avatar_admin->original['file'] ) > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {
    249279                $bp->avatar_admin->resized = wp_create_thumbnail( $bp->avatar_admin->original['file'], BP_AVATAR_ORIGINAL_MAX_WIDTH );
    250280        }
    251        
     281
    252282        $bp->avatar_admin->image = new stdClass;
    253        
    254         // We only want to handle one image after resize. 
     283
     284        // We only want to handle one image after resize.
    255285        if ( empty( $bp->avatar_admin->resized ) )
    256286                $bp->avatar_admin->image->dir = $bp->avatar_admin->original['file'];
    257287        else {
    258288                $bp->avatar_admin->image->dir = $bp->avatar_admin->resized;
    259289                @unlink( $bp->avatar_admin->original['file'] );
    260290        }
    261        
     291
    262292        /* Set the url value for the image */
    263293        $bp->avatar_admin->image->url = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $bp->avatar_admin->image->dir );
    264294
     
    267297
    268298function bp_core_avatar_handle_crop( $args = '' ) {
    269299        global $bp;
    270        
     300
    271301        $defaults = array(
    272302                'object' => 'user',
    273303                'avatar_dir' => 'avatars',
    274304                'item_id' => false,
    275305                'original_file' => false,
    276                 'crop_w' => BP_AVATAR_FULL_WIDTH,
    277                 'crop_h' => BP_AVATAR_FULL_HEIGHT,
     306                'crop_w' => bp_get_core_avatar_full_width(),
     307                'crop_h' => bp_get_core_avatar_full_height(),
    278308                'crop_x' => 0,
    279309                'crop_y' => 0
    280310        );
    281311
    282312        $r = wp_parse_args( $args, $defaults );
    283313        extract( $r, EXTR_SKIP );
    284        
     314
    285315        if ( !$original_file )
    286316                return false;
    287317
    288318        if ( !file_exists( WP_CONTENT_DIR . '/' . $original_file ) )
    289319                return false;
    290                        
     320
    291321        if ( !$item_id )
    292                 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir ); 
     322                $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir );
    293323        else
    294324                $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    295325
    296326        if ( !file_exists( $avatar_folder_dir ) )
    297327                return false;
    298        
     328
    299329        require_once( ABSPATH . '/wp-admin/includes/image.php' );
    300330        require_once( ABSPATH . '/wp-admin/includes/file.php' );
    301331
    302332        /* Delete the existing avatar files for the object */
    303333        bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
    304        
     334
    305335        /* Make sure we at least have a width and height for cropping */
    306336        if ( !(int)$crop_w )
    307                 $crop_w = BP_AVATAR_FULL_WIDTH;
    308        
     337                $crop_w = bp_get_core_avatar_full_width();
     338
    309339        if ( !(int)$crop_h )
    310                 $crop_h = BP_AVATAR_FULL_HEIGHT;
     340                $crop_h = bp_get_core_avatar_full_height();
    311341
    312342        /* Set the full and thumb filenames */
    313343        $full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg';
    314344        $thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg';
    315                        
     345
    316346        /* Crop the image */
    317         $full_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_FULL_WIDTH, BP_AVATAR_FULL_HEIGHT, false, $avatar_folder_dir . '/' . $full_filename );
    318         $thumb_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_THUMB_WIDTH, BP_AVATAR_THUMB_HEIGHT, false, $avatar_folder_dir . '/' . $thumb_filename );
    319        
     347        $full_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_get_core_avatar_full_width(), bp_get_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
     348        $thumb_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_get_core_avatar_thumb_width(), bp_get_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
     349
    320350        /* Remove the original */
    321351        @unlink( WP_CONTENT_DIR . $original_file );
    322352
     
    327357function bp_core_fetch_avatar_filter( $avatar, $id_or_email, $size, $default, $alt ) {
    328358        if ( is_object ( $id_or_email ) )
    329359                $id_or_email = $id_or_email->user_id;
    330        
     360
    331361        $bp_avatar = bp_core_fetch_avatar( array( 'no_grav' => true, 'item_id' => $id_or_email, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
    332362
    333363        return ( !$bp_avatar ) ? $avatar : $bp_avatar;
     
    337367function bp_core_check_avatar_upload($file) {
    338368        if ( $file['error'] )
    339369                return false;
    340        
     370
    341371        return true;
    342372}
    343373
    344374function bp_core_check_avatar_size($file) {
    345375        if ( $file['file']['size'] > BP_AVATAR_ORIGINAL_MAX_FILESIZE )
    346376                return false;
    347        
     377
    348378        return true;
    349379}
    350380
    351381function bp_core_check_avatar_type($file) {
    352382        if ( ( strlen($file['file']['type']) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) && !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
    353383                return false;
    354        
     384
    355385        return true;
    356386}
    357387
  • bp-core/bp-core-cssjs.php

     
    9494        global $bp;
    9595       
    9696        $image = apply_filters( 'bp_inline_cropper_image', getimagesize( $bp->avatar_admin->image->dir ) );
     97
     98        $width = (int)bp_get_core_avatar_full_width();
     99        $height = (int)bp_get_core_avatar_full_height();
     100       
     101        // Calculate Aspect Ratio
     102        if ( $width == $height )
     103                $aspect_ratio = 1;
     104        elseif ( $width != $height )
     105                $aspect_ratio = $width / $height;
     106       
    97107?>
    98108        <script type="text/javascript">
    99109                jQuery(window).load( function(){
     
    101111                                onChange: showPreview,
    102112                                onSelect: showPreview,
    103113                                onSelect: updateCoords,
    104                                 aspectRatio: 1,
     114                                aspectRatio: <?php echo $aspect_ratio ?>,
    105115                                setSelect: [ 50, 50, 200, 200 ]
    106116                        });
    107117                });
     
    115125
    116126                function showPreview(coords) {
    117127                        if ( parseInt(coords.w) > 0 ) {
    118                                 var rx = 100 / coords.w;
    119                                 var ry = 100 / coords.h;
     128                                var rx = <?php bp_core_avatar_full_width() ?> / coords.w;
     129                                var ry = <?php bp_core_avatar_full_height() ?> / coords.h;
    120130
    121131                                jQuery('#avatar-crop-preview').css({
    122132                                        width: Math.round(rx * <?php echo $image[0] ?>) + 'px',
  • bp-themes/bp-sn-framework/groups/single/admin.php

     
    152152                               
    153153                                                        <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    154154                               
    155                                                         <div id="avatar-crop-pane">
     155                                                        <div id="avatar-crop-pane" style="width:<?php bp_core_avatar_full_width() ?>px;height:<?php bp_core_avatar_full_height() ?>px;overflow:hidden;">
    156156                                                                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    157157                                                        </div>
    158158
  • bp-themes/bp-sn-framework/profile/change-avatar.php

     
    5151                               
    5252                                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    5353                               
    54                                 <div id="avatar-crop-pane" style="width:100px;height:100px;overflow:hidden;">
     54                                <div id="avatar-crop-pane" style="width:<?php bp_core_avatar_full_width() ?>px;height:<?php bp_core_avatar_full_height() ?>px;overflow:hidden;">
    5555                                        <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    5656                                </div>
    5757
  • bp-themes/bp-sn-framework/registration/register.php

     
    249249                       
    250250                                                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    251251                       
    252                                                 <div id="avatar-crop-pane" style="width:100px;height:100px;overflow:hidden;">
     252                                                <div id="avatar-crop-pane" style="width:<?php bp_core_avatar_full_width() ?>px;height:<?php bp_core_avatar_full_height() ?>px;overflow:hidden;">
    253253                                                        <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    254254                                                </div>
    255255