diff --git src/bp-core/classes/class-bp-attachment-avatar.php src/bp-core/classes/class-bp-attachment-avatar.php
index 91cd15c..604ee23 100644
--- src/bp-core/classes/class-bp-attachment-avatar.php
+++ src/bp-core/classes/class-bp-attachment-avatar.php
@@ -119,7 +119,6 @@ class BP_Attachment_Avatar extends BP_Attachment {
 	 * @since 2.3.0
 	 *
 	 * @uses  bp_core_avatar_original_max_width()
-	 * @uses  wp_get_image_editor()
 	 *
 	 * @param string $file the absolute path to the file.
 	 *
@@ -127,39 +126,40 @@ class BP_Attachment_Avatar extends BP_Attachment {
 	 */
 	public static function shrink( $file = '' ) {
 		// Get image size
-		$size   = @getimagesize( $file );
-		$retval = false;
+		$avatar_data = parent::get_image_data( $file );
 
-		// Check image size and shrink if too large
-		if ( $size[0] > bp_core_avatar_original_max_width() ) {
-			$editor = wp_get_image_editor( $file );
+		// Init the edit args
+		$edit_args = array();
 
-			if ( ! is_wp_error( $editor ) ) {
-				$editor->set_quality( 100 );
+		// Do we need to resize the image ?
+		if ( isset( $avatar_data['width'] ) && $avatar_data['width'] > bp_core_avatar_original_max_width() ) {
+			$edit_args = array(
+				'max_w' => bp_core_avatar_original_max_width(),
+				'max_h' => bp_core_avatar_original_max_width(),
+			);
+		}
 
-				$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() );
-				} else {
-					$retval = $resized;
-				}
+		// Do we need to rotate the image ?
+		$angles = array(
+			3 => 180,
+			6 => -90,
+			8 =>  90,
+		);
 
-				// Check for thumbnail creation errors
-				if ( ( false === $retval ) && is_wp_error( $thumb ) ) {
-					$retval = $thumb;
-				}
+		if ( isset( $avatar_data['meta']['orientation'] ) && isset( $angles[ $avatar_data['meta']['orientation'] ] ) ) {
+			$edit_args['rotate'] = $angles[ $avatar_data['meta']['orientation'] ];
+		}
 
-				// Thumbnail is good so proceed
-				if ( false === $retval ) {
-					$retval = $thumb;
-				}
+		// No need to edit the avatar, original file will be used
+		if ( empty( $edit_args ) ) {
+			return false;
 
-			} else {
-				$retval = $editor;
-			}
+		// Add the file to the edit arguments
+		} else {
+			$edit_args['file'] = $file;
 		}
 
-		return $retval;
+		return parent::edit_image( 'avatar', $edit_args );
 	}
 
 	/**
diff --git src/bp-core/classes/class-bp-attachment-cover-image.php src/bp-core/classes/class-bp-attachment-cover-image.php
index fc700f9..ed32cbc 100644
--- src/bp-core/classes/class-bp-attachment-cover-image.php
+++ src/bp-core/classes/class-bp-attachment-cover-image.php
@@ -138,39 +138,52 @@ class BP_Attachment_Cover_Image extends BP_Attachment {
 		}
 
 		// Get image size
-		$size   = @getimagesize( $file );
-		$retval = false;
-
-		// Check image size and shrink if too large
-		if ( $size[0] > $dimensions['width'] || $size[1] > $dimensions['height'] ) {
-			$editor = wp_get_image_editor( $file );
-
-			if ( ! is_wp_error( $editor ) ) {
-				$editor->set_quality( 100 );
-
-				$resized = $editor->resize( $dimensions['width'], $dimensions['height'], true );
-				if ( ! is_wp_error( $resized ) ) {
-					$cover   = $editor->save( $this->generate_filename( $file ) );
-				} else {
-					$retval = $resized;
-				}
-
-				// Check for cover creation errors
-				if ( ( false === $retval ) && is_wp_error( $cover ) ) {
-					$retval = $cover;
-				}
-
-				// Cover is good so proceed
-				if ( false === $retval ) {
-					$retval = $cover;
-				}
-
-			} else {
-				$retval = $editor;
-			}
+		$cover_data = parent::get_image_data( $file );
+
+		// Init the edit args
+		$edit_args = array();
+
+		// Do we need to resize the image ?
+		if ( ( isset( $cover_data['width'] ) && $cover_data['width'] > $dimensions['width'] ) ||
+		( isset( $cover_data['height'] ) && $cover_data['height'] > $dimensions['height'] ) ) {
+			$edit_args = array(
+				'max_w' => $dimensions['width'],
+				'max_h' => $dimensions['height'],
+				'crop'  => true,
+			);
+		}
+
+		// Do we need to rotate the image ?
+		$angles = array(
+			3 => 180,
+			6 => -90,
+			8 =>  90,
+		);
+
+		if ( isset( $cover_data['meta']['orientation'] ) && isset( $angles[ $cover_data['meta']['orientation'] ] ) ) {
+			$edit_args['rotate'] = $angles[ $cover_data['meta']['orientation'] ];
+		}
+
+		// No need to edit the avatar, original file will be used
+		if ( empty( $edit_args ) ) {
+			return false;
+
+		// Add the file to the edit arguments
+		} else {
+			$edit_args = array_merge( $edit_args, array( 'file' => $file, 'save' => false ) );
+		}
+
+		// Get the editor so that we can use a specific save method
+		$editor = parent::edit_image( 'cover_image', $edit_args );
+
+		if ( is_wp_error( $editor ) )  {
+			return $editor;
+		} elseif ( ! is_a( $editor, 'WP_Image_Editor' ) ) {
+			return false;
 		}
 
-		return $retval;
+		// Save the new image file
+		return $editor->save( $this->generate_filename( $file ) );
 	}
 
 	/**
diff --git src/bp-core/classes/class-bp-attachment.php src/bp-core/classes/class-bp-attachment.php
index 7ea8c50..7a3143d 100644
--- src/bp-core/classes/class-bp-attachment.php
+++ src/bp-core/classes/class-bp-attachment.php
@@ -521,4 +521,142 @@ abstract class BP_Attachment {
 
 		return $script_data;
 	}
+
+	/**
+	 * Get full data for an image
+	 *
+	 * @since  2.4.0
+	 *
+	 * @param  string $file Absolute path to the uploaded image.
+	 * @return bool|array   An associate array containing the width, height and metadatas.
+	 *                      False in case an important image attribute is missing.
+	 */
+	public static function get_image_data( $file ) {
+		// Try to get image basic data
+		list( $width, $height, $sourceImageType ) = @getimagesize( $file );
+
+		// No need to carry on if we couldn't get image's basic data.
+		if ( is_null( $width ) || is_null( $height ) || is_null( $sourceImageType ) ) {
+			return false;
+		}
+
+		// Initialize the image data
+		$image_data = array(
+			'width'  => $width,
+			'height' => $height,
+		);
+
+		/**
+		 * Make sure the wp_read_image_metadata function is reachable for the old Avatar UI
+		 * or if WordPress < 3.9 (New Avatar UI is not available in this case)
+		 */
+		if ( ! function_exists( 'wp_read_image_metadata' ) ) {
+			require_once( ABSPATH . 'wp-admin/includes/image.php' );
+		}
+
+		// Now try to get image's meta data
+		$meta = wp_read_image_metadata( $file );
+
+		if ( ! empty( $meta ) ) {
+			// Before 4.0 the Orientation wasn't included
+			if ( ! isset( $meta['orientation'] ) &&
+				is_callable( 'exif_read_data' ) &&
+				in_array( $sourceImageType, apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) )
+			) {
+				$exif = exif_read_data( $file );
+
+				if ( ! empty( $exif['Orientation'] ) ) {
+					$meta['orientation'] = $exif['Orientation'];
+				}
+			}
+
+			// Now add the metas to image data
+			$image_data['meta'] = $meta;
+		}
+
+		/**
+		 * Filter here to add/remove/edit data to the image full data
+		 *
+		 * @since  2.4.0
+		 *
+		 * @param  array $image_data An associate array containing the width, height and metadatas.
+		 */
+		return apply_filters( 'bp_attachments_get_image_data', $image_data );
+	}
+
+	/**
+	 * Edit an image file to resize it or rotate it
+	 *
+	 * @since  2.4.0
+	 *
+	 * @param  string $attachment_type The attachment type (eg: avatar or cover_image). Required.
+	 * @param  array  array $args {
+	 *     @type string $file     Absolute path to the image file (required).
+	 *     @type int    $max_w    Max width attribute for the editor's resize method (optional).
+	 *     @type int    $max_h    Max height attribute for the editor's resize method (optional).
+	 *     @type bool   $crop     Crop attribute for the editor's resize method (optional).
+	 *     @type float  $rotate   Angle for the editor's rotate method (optional).
+	 *     @type int    $quality  Compression quality on a 1-100% scale (optional).
+	 *     @type bool   $save     Whether to use the editor's save method or not (optional).
+	 * }
+	 *
+	 * @return string|WP_Image_Editor|WP_Error The edited image path or the WP_Image_Editor object in case of success,
+	 *                                         an WP_Error object otherwise.
+	 */
+	public static function edit_image( $attachment_type, $args = array() ) {
+		if ( empty( $attachment_type ) ) {
+			return new WP_Error( 'missing_parameter' );
+		}
+
+		$r = bp_parse_args( $args, array(
+			'file'   => '',
+			'max_w'   => 0,
+			'max_h'   => 0,
+			'crop'    => false,
+			'rotate'  => 0,
+			'quality' => 90,
+			'save'    => true,
+		), 'attachment_' . $attachment_type . '_edit_image' );
+
+		// Make sure we have to edit the image.
+		if ( empty( $r['max_w'] ) && empty( $r['max_h'] ) && empty( $r['rotate'] ) && empty( $r['file'] ) ) {
+			return new WP_Error( 'missing_parameter' );
+		}
+
+		// Get the image editor
+		$editor = wp_get_image_editor( $r['file'] );
+
+		if ( is_wp_error( $editor ) ) {
+			return $editor;
+		}
+
+		$editor->set_quality( $r['quality'] );
+
+		if ( ! empty( $r['rotate'] ) ) {
+			$rotated = $editor->rotate( $r['rotate'] );
+
+			// Stop in case of error
+			if ( is_wp_error( $rotated ) ) {
+				return $rotated;
+			}
+		}
+
+		if ( ! empty( $r['max_w'] ) || ! empty( $r['max_h'] ) ) {
+			$resized = $editor->resize( $r['max_w'], $r['max_h'], $r['crop'] );
+
+			// Stop in case of error
+			if ( is_wp_error( $resized ) ) {
+				return $resized;
+			}
+		}
+
+		// Use the editor save method to get a path to the edited image
+		if ( true === $r['save'] ) {
+			return $editor->save( $editor->generate_filename() );
+
+		// Need to do some other edit actions or use a specific method to save file
+		} else {
+			return $editor;
+		}
+	}
 }
diff --git tests/phpunit/testcases/core/class-bp-attachment.php tests/phpunit/testcases/core/class-bp-attachment.php
index 35d0476..adacf38 100644
--- tests/phpunit/testcases/core/class-bp-attachment.php
+++ tests/phpunit/testcases/core/class-bp-attachment.php
@@ -364,4 +364,66 @@ class BP_Tests_BP_Attachment_TestCases extends BP_UnitTestCase {
 		$_FILES = $reset_files;
 		$_POST = $reset_post;
 	}
+
+	/**
+	 * @ticket BP5089
+	 */
+	public function test_bp_attachment_avatar_shrink() {
+		$image = BP_TESTS_DIR . 'assets/upside-down.jpg';
+
+		$dir_copy = bp_upload_dir();
+
+		// in case cleaning files fails
+		if ( ! is_dir( $dir_copy['basedir'] . '/shrink' ) ) {
+			mkdir( $dir_copy['basedir'] . '/shrink' );
+		}
+
+		$abs_path_copy = $dir_copy['basedir'] . '/shrink/upside-down.jpg';
+
+		copy( $image, $abs_path_copy );
+
+		add_filter( 'bp_core_avatar_original_max_width', array( $this, 'limit_to_50px' ) );
+
+		$shrink = BP_Attachment_Avatar::shrink( $abs_path_copy );
+
+		remove_filter( 'bp_core_avatar_original_max_width', array( $this, 'limit_to_50px' ) );
+
+		$this->assertTrue( 50 === $shrink['width'] && 50 === $shrink['height'] );
+
+		// Cleanup
+		$this->clean_files( 'shrink' );
+	}
+
+	public function limit_to_50px( $max_width ) {
+		return 50;
+	}
+
+	/**
+	 * @ticket BP5089
+	 */
+	public function test_bp_attachment_cover_image_fit() {
+		$image = BP_TESTS_DIR . 'assets/upside-down.jpg';
+
+		$cover_image_class = new BP_Attachment_Cover_Image();
+
+		$abs_path_copy = $cover_image_class->upload_path . '/upside-down.jpg';
+
+		copy( $image, $abs_path_copy );
+
+		$fit = $cover_image_class->fit( $abs_path_copy, array( 'width' => 50, 'height' => 50 ) );
+
+		$this->assertTrue( 50 === $fit['width'] && 50 === $fit['height'] );
+
+		// Cleanup
+		$this->clean_files( 'buddypress' );
+	}
+
+	/**
+	 * @ticket BP5089
+	 */
+	public function test_bp_attachment_get_image_data() {
+		$image_data = BP_Attachment::get_image_data( BP_TESTS_DIR . 'assets/upside-down.jpg' );
+
+		$this->assertTrue( 3 === $image_data['meta']['orientation'] );
+	}
 }
