Calculate video output size taking into account portrait mode (#5068)
This commit is contained in:
parent
7c982a30cb
commit
33aa7a914f
3 changed files with 9 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ fun BitmapFactory.Options.calculateInSampleSize(desiredWidth: Int, desiredHeight
|
|||
* Decodes the [inputStream] into a [Bitmap] and applies the needed rotation based on [orientation].
|
||||
* This orientation value must be one of `ExifInterface.ORIENTATION_*` constants.
|
||||
*/
|
||||
fun Bitmap.rotateToMetadataOrientation(orientation: Int): Bitmap {
|
||||
fun Bitmap.rotateToExifMetadataOrientation(orientation: Int): Bitmap {
|
||||
val matrix = Matrix()
|
||||
when (orientation) {
|
||||
ExifInterface.ORIENTATION_ROTATE_270 -> matrix.postRotate(270f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue