Hello,
I wish I had a dollar for every time I've addressed this issue in the last few years – I would be a rich guy .
I have an app that allows a snapshot to be taken from the camera and the image displayed within the app. I use the intent from NJDude (Thanks NJDude):
https://www.b4x.com/android/forum/t...ack-from-camera-app-intent.11378/#post-132920
This intent returns a JPEG file, using the filename passed.
The image is rotated depending on the orientation (portrait/landscape) of my app and the orientation of the device when the snapshot was taken.
With my app in portrait and the snapshot taken in portrait, I find I have to rotate the image within the return file 90° to display it properly in my app. If the app is in portrait, but the snapshot image was taken holding the device in landscape, I don't have to rotate the image 90°.
In both cases the width and height of the image reported is the same. The difference is in the actual orientation of the image within the file.
I think there are two things going on here: 1) There is the device rotation. 2) And there is the image rotation. This may be stored as part of the image, maybe as Exif information, and describes the camera orientation when the picture was taken.
Erel has previously posted some code to determine the device rotation. Is there a way to get the image rotation information? I am thinking one needs to use a combination of both to properly display an image file.
Is there a way to get the image rotation information as part of the return from the intent? Another way?
Am I still barking up the wrong tree?
Thanks,
Barry.
I wish I had a dollar for every time I've addressed this issue in the last few years – I would be a rich guy .
I have an app that allows a snapshot to be taken from the camera and the image displayed within the app. I use the intent from NJDude (Thanks NJDude):
https://www.b4x.com/android/forum/t...ack-from-camera-app-intent.11378/#post-132920
This intent returns a JPEG file, using the filename passed.
The image is rotated depending on the orientation (portrait/landscape) of my app and the orientation of the device when the snapshot was taken.
With my app in portrait and the snapshot taken in portrait, I find I have to rotate the image within the return file 90° to display it properly in my app. If the app is in portrait, but the snapshot image was taken holding the device in landscape, I don't have to rotate the image 90°.
In both cases the width and height of the image reported is the same. The difference is in the actual orientation of the image within the file.
I think there are two things going on here: 1) There is the device rotation. 2) And there is the image rotation. This may be stored as part of the image, maybe as Exif information, and describes the camera orientation when the picture was taken.
Erel has previously posted some code to determine the device rotation. Is there a way to get the image rotation information? I am thinking one needs to use a combination of both to properly display an image file.
Is there a way to get the image rotation information as part of the return from the intent? Another way?
Am I still barking up the wrong tree?
Thanks,
Barry.