|
@@ -8,8 +8,6 @@ import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
|
|
|
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
|
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
|
|
import io.legado.app.utils.stackBlur
|
|
import io.legado.app.utils.stackBlur
|
|
|
import java.security.MessageDigest
|
|
import java.security.MessageDigest
|
|
|
-import kotlin.math.min
|
|
|
|
|
-import kotlin.math.roundToInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,11 +26,7 @@ class BlurTransformation(
|
|
|
outHeight: Int
|
|
outHeight: Int
|
|
|
): Bitmap {
|
|
): Bitmap {
|
|
|
val transform = super.transform(pool, toTransform, outWidth, outHeight)
|
|
val transform = super.transform(pool, toTransform, outWidth, outHeight)
|
|
|
- //图片缩小1/2
|
|
|
|
|
- val width = (min(outWidth, transform.width) / 5f).roundToInt()
|
|
|
|
|
- val height = (min(outHeight, transform.height) / 5f).roundToInt()
|
|
|
|
|
- val blurredBitmap = Bitmap.createScaledBitmap(transform, width, height, false)
|
|
|
|
|
- return blurredBitmap.stackBlur(radius)
|
|
|
|
|
|
|
+ return transform.stackBlur(radius)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun updateDiskCacheKey(messageDigest: MessageDigest) {
|
|
override fun updateDiskCacheKey(messageDigest: MessageDigest) {
|