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

Commit f4354a83 authored by Ray Essick's avatar Ray Essick Committed by Automerger Merge Worker
Browse files

Merge "Use a ExifInterface ctor with a file descriptor as a parameter" am:...

Merge "Use a ExifInterface ctor with a file descriptor as a parameter" am: f715c615 am: d514714e am: ac319831 am: 1fd2378e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2485757



Change-Id: I2dc08648f2c2c57490f6b92f865bd466af01b09e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 62a1fd60 1fd2378e
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.internal.util.ArrayUtils;
import libcore.io.IoUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
@@ -255,7 +256,8 @@ public class ThumbnailUtils {

        // get orientation
        if (MediaFile.isExifMimeType(mimeType)) {
            exif = new ExifInterface(file);
            try (FileInputStream is = new FileInputStream(file)) {
                exif = new ExifInterface(is.getFD());
                switch (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0)) {
                    case ExifInterface.ORIENTATION_ROTATE_90:
                        orientation = 90;
@@ -268,6 +270,7 @@ public class ThumbnailUtils {
                        break;
                }
            }
        }

        if (mimeType.equals("image/heif")
                || mimeType.equals("image/heif-sequence")