Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0764ce28 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "Use rotation from MediaMetadataRetriever directly" into oc-mr1-dev

am: 106aeb32

Change-Id: I5d7bbd0a3fb5f291f79a2e9009319eb4e57848a4
parents 6a834447 106aeb32
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2583,22 +2583,21 @@ public class ExifInterface {
                            ExifAttribute.createUShort(Integer.parseInt(height), mExifByteOrder));
                }

                // Note that the rotation angle from MediaMetadataRetriever for heif images
                // are CCW, while rotation in ExifInterface orientations are CW.
                String rotation = retriever.extractMetadata(
                        MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
                if (rotation != null) {
                    int orientation = ExifInterface.ORIENTATION_NORMAL;

                    // all rotation angles in CW
                    switch (Integer.parseInt(rotation)) {
                        case 90:
                            orientation = ExifInterface.ORIENTATION_ROTATE_270;
                            orientation = ExifInterface.ORIENTATION_ROTATE_90;
                            break;
                        case 180:
                            orientation = ExifInterface.ORIENTATION_ROTATE_180;
                            break;
                        case 270:
                            orientation = ExifInterface.ORIENTATION_ROTATE_90;
                            orientation = ExifInterface.ORIENTATION_ROTATE_270;
                            break;
                    }