Skip to content

Instantly share code, notes, and snippets.

View arieftb's full-sized avatar
😍
Exited

Arief T Bagus (TB) arieftb

😍
Exited
View GitHub Profile
@arieftb
arieftb / BitmapImageRotation.kt
Created May 1, 2022 04:41
Check auto rotation get image from camera and rotate to real orientation example
import android.graphics.Bitmap
import android.graphics.Matrix
import android.media.ExifInterface
object BitmapImageRotation {
fun getRotatedImage(path: String, bitmap: Bitmap): Bitmap {
val exifInterface = ExifInterface(path)
return when (exifInterface.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_UNDEFINED