mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
always use exif helper
This commit is contained in:
parent
27f42dfb63
commit
49920649db
@ -164,29 +164,12 @@ public class FileBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getRotation(Uri image) {
|
private int getRotation(Uri image) {
|
||||||
if ("content".equals(image.getScheme())) {
|
try {
|
||||||
try {
|
InputStream is = mXmppConnectionService.getContentResolver()
|
||||||
Cursor cursor = mXmppConnectionService
|
.openInputStream(image);
|
||||||
.getContentResolver()
|
return ExifHelper.getOrientation(is);
|
||||||
.query(image,
|
} catch (FileNotFoundException e) {
|
||||||
new String[] { MediaStore.Images.ImageColumns.ORIENTATION },
|
return 0;
|
||||||
null, null, null);
|
|
||||||
if (cursor.getCount() != 1) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
cursor.moveToFirst();
|
|
||||||
return cursor.getInt(0);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
InputStream is = mXmppConnectionService.getContentResolver()
|
|
||||||
.openInputStream(image);
|
|
||||||
return ExifHelper.getOrientation(is);
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user