[buddypress-trac] [BuddyPress Trac] #6634: Wrong Thumb size (Thumb == Full)

buddypress-trac noreply at wordpress.org
Thu Sep 24 16:52:44 UTC 2015


#6634: Wrong Thumb size (Thumb == Full)
-------------------------------------+-----------------------------
 Reporter:  damland                  |      Owner:
     Type:  defect (bug)             |     Status:  new
 Priority:  highest                  |  Milestone:  Awaiting Review
Component:  Component - Attachments  |    Version:  2.3.3
 Severity:  major                    |   Keywords:  has-patch
-------------------------------------+-----------------------------
 Since last ver. when the users upload their avatar the thumb has the same
 size of the full size image.

 more info here:
 https://buddypress.org/support/topic/why-bpthumb-bpfull/

 Please fix it asap or websites will take forever to load thumbs, Thanks.
 Bug fix is here:

 /wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-
 avatar.php
 added lines 263-268
 the cropping function was using only the full avatar size for the thumb
 too


 // Get the file extension
 $data = @getimagesize( $absolute_path );
 $ext = $data[‘mime’] == ‘image/png’ ? ‘png’ : ‘jpg’;

 $args[‘original_file’] = $absolute_path;
 $args[‘src_abs’] = false;
 $avatar_types = array( ‘full’ => ”, ‘thumb’ => ” );

 foreach ( $avatar_types as $key_type => $type ) {
 $args[‘dst_w’] = bp_core_avatar_full_width();
 $args[‘dst_h’] = bp_core_avatar_full_height();
 /*BUG FIX start*/
 if($key_type==’thumb’){
 $args[‘dst_w’] = bp_core_avatar_thumb_width();
 $args[‘dst_h’] = bp_core_avatar_thumb_height();
 }
 /*BUG FIX end*/
 $args[‘dst_file’] = $avatar_folder_dir . ‘/’ . wp_hash( $absolute_path .
 time() ) . ‘-bp’ . $key_type . ‘.’ . $ext;

 $avatar_types[ $key_type ] = parent::crop( $args );
 }

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6634>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list