mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
android, desktop: fix showing big gifs (opens in viewer) (#5660)
This commit is contained in:
parent
4f00f9efa0
commit
b96b6c70d2
1 changed files with 3 additions and 2 deletions
|
@ -8,6 +8,7 @@ import androidx.compose.material.*
|
|||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Size
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
|
@ -122,7 +123,7 @@ fun CIImageView(
|
|||
// IllegalStateException: Recording currently in progress - missing #endRecording() call?
|
||||
// but can display 5000px image. Using even lower value here just to feel safer.
|
||||
// It happens to WebP because it's not compressed while sending since it can be animated.
|
||||
if (painter.intrinsicSize.width <= 4320 && painter.intrinsicSize.height <= 4320) {
|
||||
if (painter.intrinsicSize != Size.Unspecified && painter.intrinsicSize.width <= 4320 && painter.intrinsicSize.height <= 4320) {
|
||||
Image(
|
||||
painter,
|
||||
contentDescription = stringResource(MR.strings.image_descr),
|
||||
|
@ -140,7 +141,7 @@ fun CIImageView(
|
|||
)
|
||||
} else {
|
||||
Box(Modifier
|
||||
.width(if (painter.intrinsicSize.width * 0.97 <= painter.intrinsicSize.height) imageViewFullWidth() * 0.75f else DEFAULT_MAX_IMAGE_WIDTH)
|
||||
.width(if (painter.intrinsicSize != Size.Unspecified && painter.intrinsicSize.width * 0.97 <= painter.intrinsicSize.height) imageViewFullWidth() * 0.75f else DEFAULT_MAX_IMAGE_WIDTH)
|
||||
.combinedClickable(
|
||||
onLongClick = { showMenu.value = true },
|
||||
onClick = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue