Fix crash when taking picture to send with chat on some devices/android

This commit is contained in:
Sylvain Berfini 2012-12-17 15:51:08 +01:00
parent 7000bc4b3d
commit 9788e09ff8

View file

@ -748,6 +748,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
// Rotate the bitmap if possible/needed, using EXIF data
try {
if (filePath != null) {
ExifInterface exif = new ExifInterface(filePath);
int pictureOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0);
Matrix matrix = new Matrix();
@ -759,6 +760,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
matrix.postRotate(270);
}
bm = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
}
} catch (Exception e) {
e.printStackTrace();
}