Use exif info of the image for correct rotation.

This commit is contained in:
onurays 2020-02-21 00:51:22 +03:00
parent d867b1345f
commit a11d70f173
2 changed files with 10 additions and 0 deletions

View file

@ -15,6 +15,7 @@ Bugfix 🐛:
- Account creation: wrongly hints that an email can be used to create an account (#941)
- Fix crash in the room directory, when public room has no name (#1023)
- Fix restoring keys backup with passphrase (#526)
- Fix rotation of full-size image (#647)
Translations 🗣:
-

View file

@ -25,6 +25,7 @@ import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.ORIENTATION_USE_EXIF
import com.github.piasy.biv.view.BigImageView
import im.vector.matrix.android.api.session.content.ContentUrlResolver
import im.vector.matrix.android.internal.crypto.attachments.ElementToDecrypt
@ -36,6 +37,7 @@ import im.vector.riotx.core.utils.DimensionConverter
import im.vector.riotx.core.utils.isLocalFile
import kotlinx.android.parcel.Parcelize
import timber.log.Timber
import java.io.File
import javax.inject.Inject
import kotlin.math.min
@ -142,6 +144,13 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
return
}
imageView.setImageLoaderCallback(object: DefaultImageLoaderCallback {
override fun onSuccess(image: File?) {
super.onSuccess(image)
imageView.ssiv.orientation = ORIENTATION_USE_EXIF
}
})
imageView.showImage(
Uri.parse(thumbnail),
Uri.parse(fullSize)