create the bitmap at saving rotated image only when necessary
This commit is contained in:
parent
67c9f875ae
commit
64b4fdece3
1 changed files with 1 additions and 1 deletions
|
@ -534,7 +534,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
val tmpFile = File(filesDir, ".tmp_${newPath.getFilenameFromPath()}")
|
val tmpFile = File(filesDir, ".tmp_${newPath.getFilenameFromPath()}")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val bitmap = BitmapFactory.decodeFile(oldPath)
|
|
||||||
getFileOutputStream(tmpFile.toFileDirItem(applicationContext)) {
|
getFileOutputStream(tmpFile.toFileDirItem(applicationContext)) {
|
||||||
if (it == null) {
|
if (it == null) {
|
||||||
toast(R.string.unknown_error_occurred)
|
toast(R.string.unknown_error_occurred)
|
||||||
|
@ -546,6 +545,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
copyFile(getCurrentFile(), tmpFile)
|
copyFile(getCurrentFile(), tmpFile)
|
||||||
saveExifRotation(ExifInterface(tmpFile.absolutePath))
|
saveExifRotation(ExifInterface(tmpFile.absolutePath))
|
||||||
} else {
|
} else {
|
||||||
|
val bitmap = BitmapFactory.decodeFile(oldPath)
|
||||||
saveFile(tmpFile, bitmap, it as FileOutputStream)
|
saveFile(tmpFile, bitmap, it as FileOutputStream)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue