Я использовал следующий код для получения изображения из галереи телефона:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
USE_LIBRARY_PIC_REQUEST);
В onActivityResult() он дает путь к файлу, я пытался получить растровое изображение, используя путь к файлу, но он всегда дает его в альбомной ориентации. Есть ли способ всегда получать это изображение в портретном режиме? Код для получения пути к файлу:
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
Вот как я получил растровое изображение, используя путь к файлу:
Bitmap bmp=BitmapFactory.decodeFile(selectedImagePath);