fix:正文图片解码大小不正确

pull/1777/head
Xwite 3 years ago
parent d09ca48242
commit 624efcb8f9
  1. 11
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt

@ -1,10 +1,6 @@
package io.legado.app.ui.book.read.page.provider
import android.graphics.Bitmap
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import io.legado.app.R
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookSource
@ -52,11 +48,12 @@ object ImageProvider {
}
}
return try {
ImageLoader.loadBitmap(appCtx, vFile.absolutePath).submit().get()
ImageLoader.loadBitmap(appCtx, vFile.absolutePath)
.submit(ChapterProvider.visibleWidth,ChapterProvider.visibleHeight)
.get()
} catch (e: Exception) {
e.printStackTrace()
Coroutine.async { vFile.delete() }
//must call this method on a background thread
//ImageLoader.loadBitmap(appCtx, R.drawable.image_loading_error).submit().get()
errorBitmap
}
}

Loading…
Cancel
Save