Revert "Use a ExifInterface ctor with a file descriptor as a parameter"
This reverts commit e106aa909b.
Reason for revert: OEM reports regressions
Bug: 199822700
Bug: 283908789
(cherry picked from https://android-review.googlesource.com/q/commit:2f9e9118ff556bca2e9651f05a821c8e570fbe52)
Merged-In: Ic00be58b718be5e53823d81fa64cb718a87ed05a
Change-Id: Ic00be58b718be5e53823d81fa64cb718a87ed05a
This commit is contained in:
committed by
Cherrypicker Worker
parent
caa08c2cad
commit
d065a828da
@@ -49,7 +49,6 @@ 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;
|
||||
@@ -256,19 +255,17 @@ public class ThumbnailUtils {
|
||||
|
||||
// get orientation
|
||||
if (MediaFile.isExifMimeType(mimeType)) {
|
||||
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;
|
||||
break;
|
||||
case ExifInterface.ORIENTATION_ROTATE_180:
|
||||
orientation = 180;
|
||||
break;
|
||||
case ExifInterface.ORIENTATION_ROTATE_270:
|
||||
orientation = 270;
|
||||
break;
|
||||
}
|
||||
exif = new ExifInterface(file);
|
||||
switch (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0)) {
|
||||
case ExifInterface.ORIENTATION_ROTATE_90:
|
||||
orientation = 90;
|
||||
break;
|
||||
case ExifInterface.ORIENTATION_ROTATE_180:
|
||||
orientation = 180;
|
||||
break;
|
||||
case ExifInterface.ORIENTATION_ROTATE_270:
|
||||
orientation = 270;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user