fix saving rotated images on the internal storage

This commit is contained in:
tibbi 2017-11-08 23:40:19 +01:00
parent 28e1d77f1b
commit 4efdb1a47a

View file

@ -541,7 +541,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
var inputStream: InputStream? = null var inputStream: InputStream? = null
var out: OutputStream? = null var out: OutputStream? = null
try { try {
out = getFileOutputStreamSync(destination.absolutePath, source.getMimeType(), getFileDocument(destination.parent)) val fileDocument = if (isPathOnSD(destination.absolutePath)) getFileDocument(destination.parent) else null
out = getFileOutputStreamSync(destination.absolutePath, source.getMimeType(), fileDocument)
inputStream = FileInputStream(source) inputStream = FileInputStream(source)
inputStream.copyTo(out!!) inputStream.copyTo(out!!)
} finally { } finally {