优化
This commit is contained in:
@@ -483,7 +483,6 @@ class CacheViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
val stream = ByteArrayOutputStream()
|
val stream = ByteArrayOutputStream()
|
||||||
resource.compress(Bitmap.CompressFormat.JPEG, 100, stream)
|
resource.compress(Bitmap.CompressFormat.JPEG, 100, stream)
|
||||||
val byteArray: ByteArray = stream.toByteArray()
|
val byteArray: ByteArray = stream.toByteArray()
|
||||||
resource.recycle()
|
|
||||||
stream.close()
|
stream.close()
|
||||||
epubBook.coverImage = Resource(byteArray, "Images/cover.jpg")
|
epubBook.coverImage = Resource(byteArray, "Images/cover.jpg")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user