mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
flip the exif fetching functions, use the deprecated one first
This commit is contained in:
@ -228,15 +228,15 @@ class PhotoFragment : ViewPagerFragment() {
|
|||||||
var orient = defaultOrientation
|
var orient = defaultOrientation
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val uri = if (medium.path.startsWith("content:/")) Uri.parse(medium.path) else Uri.fromFile(File(medium.path))
|
val exif = android.media.ExifInterface(medium.path)
|
||||||
val inputStream = context!!.contentResolver.openInputStream(uri)
|
orient = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, defaultOrientation)
|
||||||
val exif = ExifInterface()
|
|
||||||
exif.readExif(inputStream, ExifInterface.Options.OPTION_ALL)
|
|
||||||
orient = exif.getTag(ExifInterface.TAG_ORIENTATION)?.getValueAsInt(defaultOrientation) ?: defaultOrientation
|
|
||||||
|
|
||||||
if (orient == defaultOrientation) {
|
if (orient == defaultOrientation) {
|
||||||
val exif2 = android.media.ExifInterface(medium.path)
|
val uri = if (medium.path.startsWith("content:/")) Uri.parse(medium.path) else Uri.fromFile(File(medium.path))
|
||||||
orient = exif2.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, defaultOrientation)
|
val inputStream = context!!.contentResolver.openInputStream(uri)
|
||||||
|
val exif2 = ExifInterface()
|
||||||
|
exif2.readExif(inputStream, ExifInterface.Options.OPTION_ALL)
|
||||||
|
orient = exif2.getTag(ExifInterface.TAG_ORIENTATION)?.getValueAsInt(defaultOrientation) ?: defaultOrientation
|
||||||
}
|
}
|
||||||
} catch (ignored: Exception) {
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user