Issues taking picture with Android (Vertical Camera | Portrait)

后端 未结 4 1536
心在旅途
心在旅途 2021-01-06 06:25

With the following code shows a preview of the camera vertically and it\'s works.. BUT!! I get a photo in landscape! :(

How I can build it vertically? I\'ve the prev

4条回答
  •  有刺的猬
    2021-01-06 06:47

    You don't need actually to rotate bitmap. It is memory consuming/slow etc... Looks like it is better in your case(saving to file right after shot) to update Exif tags in a JPEG file, for example:

        int degrees = 90;
        ExifInterface exif = new ExifInterface(path);
        exif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(degrees));
        exif.saveAttributes();
    

提交回复
热议问题