always use exif helper

This commit is contained in:
iNPUTmice 2014-11-03 11:20:32 +01:00
parent 27f42dfb63
commit 49920649db

View file

@ -164,29 +164,12 @@ public class FileBackend {
}
private int getRotation(Uri image) {
if ("content".equals(image.getScheme())) {
try {
Cursor cursor = mXmppConnectionService
.getContentResolver()
.query(image,
new String[] { MediaStore.Images.ImageColumns.ORIENTATION },
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;
}
try {
InputStream is = mXmppConnectionService.getContentResolver()
.openInputStream(image);
return ExifHelper.getOrientation(is);
} catch (FileNotFoundException e) {
return 0;
}
}