Android : Getting a zoomed out picture from exhif interface

Viewed 38

I'm using Exif interface to get the desired orientation of the image but the bitmap I get is just a part of the original picture zoomed out to fit the imageView.How do I get the whole picture(Image Resolution - 2048 x 1152)?

bitmap1 = BitmapFactory.decodeFile(selectedImagePath);
                    int rotate = 0;
                    try {
                        ExifInterface exif = new ExifInterface(selectedImagePath);
                        int orientation = exif.getAttributeInt(
                                ExifInterface.TAG_ORIENTATION,
                                ExifInterface.ORIENTATION_NORMAL);

                        switch (orientation) {
                            case ExifInterface.ORIENTATION_ROTATE_270:
                                rotate = 270;
                                break;
                            case ExifInterface.ORIENTATION_ROTATE_180:
                                rotate = 180;
                                break;
                            case ExifInterface.ORIENTATION_ROTATE_90:
                                rotate = 90;
                                break;
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    Matrix matrix = new Matrix();
                    matrix.postRotate(rotate);
                    bitmap1 = Bitmap.createBitmap(bitmap1, 0, 0, bitmap1.getWidth(),bitmap1.getHeight(), matrix, true);
0 Answers
Related