You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to crop an image that has an EXIF value of 2, 4, 5 or 7 and see that the image is in fact not correctly mirrored:
This is an image with EXIF value of 2
Proposed solution
From a quick overview it seems that you should be able to pretty easily update the rotate function by exif value to also flip the image
Describe the bug
EXIF values not only define rotation but also mirroring, see EXIF values 2, 4, 5, 7:
But sadly that is not implemented in this library.
To Reproduce
Steps to reproduce the behavior:
SAMPLE USING CROPIMAGEVIEW
The exact images used are:
https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_2.jpg
https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_4.jpg
https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_5.jpg
https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_7.jpg
Try to crop an image that has an EXIF value of 2, 4, 5 or 7 and see that the image is in fact not correctly mirrored:
This is an image with EXIF value of 2
Expected behavior
Make use of these enums:
https://developer.android.com/reference/androidx/exifinterface/media/ExifInterface#ORIENTATION_FLIP_HORIZONTAL
https://developer.android.com/reference/androidx/exifinterface/media/ExifInterface#ORIENTATION_FLIP_VERTICAL
https://developer.android.com/reference/androidx/exifinterface/media/ExifInterface#ORIENTATION_TRANSPOSE
https://developer.android.com/reference/androidx/exifinterface/media/ExifInterface#ORIENTATION_TRANSVERSE
Which define what tranformations you need to apply to the image to get the correct orientation.
Media
You can test this out yourself by using the images provided in this repo:
https://github.com/recurser/exif-orientation-examples
Proposed solution
From a quick overview it seems that you should be able to pretty easily update the rotate function by exif value to also flip the image
Android-Image-Cropper/cropper/src/main/java/com/canhub/cropper/BitmapUtils.kt
Lines 90 to 107 in 2f867e9
The text was updated successfully, but these errors were encountered: