优化
This commit is contained in:
@@ -14,6 +14,7 @@ import io.legado.app.help.coroutine.Coroutine
|
|||||||
import io.legado.app.model.localBook.EpubFile
|
import io.legado.app.model.localBook.EpubFile
|
||||||
import io.legado.app.utils.BitmapUtils
|
import io.legado.app.utils.BitmapUtils
|
||||||
import io.legado.app.utils.FileUtils
|
import io.legado.app.utils.FileUtils
|
||||||
|
import io.legado.app.utils.isXml
|
||||||
import splitties.init.appCtx
|
import splitties.init.appCtx
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
@@ -88,10 +89,8 @@ object ImageProvider {
|
|||||||
op.inJustDecodeBounds = true
|
op.inJustDecodeBounds = true
|
||||||
BitmapFactory.decodeFile(file.absolutePath, op)
|
BitmapFactory.decodeFile(file.absolutePath, op)
|
||||||
if (op.outWidth < 1 && op.outHeight < 1) {
|
if (op.outWidth < 1 && op.outHeight < 1) {
|
||||||
Coroutine.async {
|
putDebug("ImageProvider: delete file due to image size ${op.outHeight}*${op.outWidth}. path: ${file.absolutePath}")
|
||||||
putDebug("ImageProvider: delete file due to image size ${op.outHeight}*${op.outWidth}. path: ${file.absolutePath}")
|
file.delete()
|
||||||
file.delete()
|
|
||||||
}
|
|
||||||
return Size(errorBitmap.width, errorBitmap.height)
|
return Size(errorBitmap.width, errorBitmap.height)
|
||||||
}
|
}
|
||||||
return Size(op.outWidth, op.outHeight)
|
return Size(op.outWidth, op.outHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user