Fixed crash if loading very large (50MB+) images (#83)

From: Feeder
This commit is contained in:
Ashinch 2022-05-25 08:26:13 +08:00 committed by GitHub
parent 4b7eb980fd
commit 31fd54254f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,8 @@ import coil.size.Scale
import coil.size.Size
import me.ash.reader.R
val Size_1000 = Size(1000, 1000)
@Composable
fun AsyncImage(
modifier: Modifier = Modifier,

View File

@ -18,11 +18,13 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import coil.size.Precision
import coil.size.Scale
import me.ash.reader.R
import me.ash.reader.data.entity.ArticleWithFeed
import me.ash.reader.data.preference.*
import me.ash.reader.ui.component.AsyncImage
import me.ash.reader.ui.component.Size_1000
import me.ash.reader.ui.ext.formatAsString
import me.ash.reader.ui.page.home.FeedIcon
@ -144,6 +146,8 @@ fun ArticleItem(
.clip(RoundedCornerShape(20.dp)),
data = articleWithFeed.article.img,
scale = Scale.FILL,
precision = Precision.INEXACT,
size = Size_1000,
contentScale = ContentScale.Crop,
)
}