Managed to make the camera save an image!

The image is saved to sdcard/DCIM/test.jpg, and shown perfectly fine if
taken in landscape orientation.
However, the image itself is tilted by 90 degree if taken in potrait
orientation.