lets provide Subsampling our own orientation

This commit is contained in:
tibbi 2017-12-01 10:04:57 +01:00
parent 2da5af065b
commit 84fee84349

View file

@ -224,12 +224,15 @@ class PhotoFragment : ViewPagerFragment() {
private fun addZoomableView() { private fun addZoomableView() {
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) { if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) {
val exif = android.media.ExifInterface(medium.path)
val orientation = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL)
ViewPagerActivity.wasDecodedByGlide = false ViewPagerActivity.wasDecodedByGlide = false
view.subsampling_view.apply { view.subsampling_view.apply {
maxScale = 10f maxScale = 10f
beVisible() beVisible()
setImage(ImageSource.uri(medium.path)) setImage(ImageSource.uri(medium.path))
orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF this.orientation = degreesForRotation(orientation)
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener { setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
override fun onImageLoaded() { override fun onImageLoaded() {
} }