
Однако при выборе изображения из галереи телефона изображение может появиться в любой ориентации и положении. Как я могу повернуть и перевернуть изображение, чтобы оно соответствовало ориентации Изображения № 1 (F)?
Вот мой текущий код:
private Bitmap getStoredImage() {
SharedPreferences sharedPreferences = requireContext().getSharedPreferences("app_prefs", Context.MODE_PRIVATE);
String imagePath = sharedPreferences.getString("front_face_image", null);
if (imagePath != null) {
File imgFile = new File(imagePath);
if (imgFile.exists()) {
return BitmapFactory.decodeFile(imgFile.getAbsolutePath());
}
}
return null; // Return null if the image path is not found or the file does not exist
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... of-its-ini
Мобильная версия