I have an app with an Android client and an iOS client. They share a common server to where they both upload photos as base64 string. The problem occurs when an iOS user uploads a photo that they snapped with the camera from within the app. Those photos are then rotated 90 degrees on the Android client.
I've understood that there is something called "Exif" where one can locate metadata, such as rotation, but I guess that data is lost when the photo comes as a base64 string?
Could this by a reliable solution?
if (width > height){
photoBitmap = rotate(photoBitmap,90f)
}
I also tried the suggestion found here: Reading EXIF data from byte array in android but that only gives me "Orientation not found" when I transform my bitmap as a byte array and use it as input to the method getOrientation(byte[] jpeg)
.
Any tips on how to solve this the correct way? Should the fix be in the Android client or the iOS client?