Image taken in portrait mode will be saved in landscape. But images taken in the landscape mode are saved correctly.
private class SaveImageTask extends Asy
Some Android camera hardware will create portrait images in landscape, with an EXIF header in the JPEG file indicating that the image viewer should rotate the image.
Some Android camera hardware will create portrait images as portrait.
There is nothing that you can really do about this. You are welcome to scan the resulting JPEG for the EXIF header and rotate the image yourself, but this is slow and memory-intensive.