Index: bp-core-avatars.php
===================================================================
--- bp-core-avatars.php	(revision 8611)
+++ bp-core-avatars.php	(working copy)
@@ -572,6 +572,9 @@
 	if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
 		return true;
 
+	//read raw image data
+	$exif = @exif_read_data( $_FILES['file']['tmp_name'] );		
+		
 	require_once( ABSPATH . '/wp-admin/includes/file.php' );
 
 	$uploadErrors = array(
@@ -626,6 +629,21 @@
 		if ( ! is_wp_error( $editor ) ) {
 			$editor->set_quality( 100 );
 
+			if( !empty( $exif['Orientation'] ) ) {
+			 
+				switch( $exif['Orientation'] ) { 
+					case 3: 
+						$image->rotate( 180 ); 
+						break; 
+					case 6: 
+						$image->rotate( -90 ); 
+						break; 
+					case 8: 
+						$image->rotate( 90 ); 
+						break;
+				} 
+			} 			
+			
 			$resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
 			if ( ! is_wp_error( $resized ) ) {
 				$thumb = $editor->save( $editor->generate_filename() );
