Glide compose crash when using GlideImage inside a Row(Modifier.height(IntrinsicSize.Min))
- Dominant language
- Java
- Stars
- 35k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
**Glide Version**: 5.0.0-rc01
```
implementation "com.github.bumptech.glide:glide:5.0.0-rc01"
implementation "com.github.bumptech.glide:okhttp3-integration:5.0.0-rc01"
implementation platform("androidx.compose:compose-bom:2023.10.01")
implementation "androidx.compose.ui:ui:"
implementation "androidx.compose.material:material"
implementation 'androidx.compose.material3:material3-android:1.2.0-beta02'
implementation "com.github.bumptech.glide:compose:1.0.0-beta01"
```
**Device/Android Version**: I only tried in the emulator
**If I use GlideImage inside Row(Modifier.height(IntrinsicSize.Min)) it crashes**:
```
Row(Modifier.height(IntrinsicSize.Min)) {
GlideImage(
model = "https://javabog.dk/JSP-lille.jpg",
contentDescription = "Text",
)
}
```
**Stack trace / LogCat**:
```
FATAL EXCEPTION: main
Process: dk.dinero.android.debug, PID: 30072
java.lang.IllegalArgumentException: Cannot round NaN value.
at kotlin.math.MathKt__MathJVMKt.roundToInt(MathJVM.kt:1165)
at com.bumptech.glide.integration.compose.GlideNode.modifyConstraints-ZezNO4M(GlideModifier.kt:571)
at com.bumptech.glide.integration.compose.GlideNode.measure-3p2s80s(GlideModifier.kt:523)
at androidx.compose.ui.node.LayoutModifierNode$minIntrinsicHeight$1.measure-3p2s80s(LayoutModifierNode.kt:92)
at androidx.compose.ui.node.NodeMeasuringIntrinsics.minHeight$ui_release(LayoutModifierNode.kt:201)
at androidx.compose.ui.node.LayoutModifierNode.minIntrinsicHeight(LayoutModifierNode.kt:90)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.minIntrinsicHeight(LayoutModifierNodeCoordinator.kt:144)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.minIntrinsicHeight(LayoutNodeLayoutDelegate.kt:785)
at androidx.compose.foundation.layout.IntrinsicMeasureBlocks$HorizontalMinHeight$1$1.invoke(RowColumnImpl.kt:465)
at androidx.compose.foundation.layout.IntrinsicMeasureBlocks$HorizontalMinHeight$1$1.invoke(RowColumnImpl.kt:463)
at androidx.compose.foundation.layout.RowColumnImplKt.intrinsicCrossAxisSize(RowColumnImpl.kt:601)
at androidx.compose.foundation.layout.RowColumnImplKt.intrinsicSize(RowColumnImpl.kt:546)
at androidx.compose.foundation.layout.RowColumnImplKt.access$intrinsicSize(RowColumnImpl.kt:1)
at androidx.compose.foundation.layout.IntrinsicMeasureBlocks$HorizontalMinHeight$1.invoke(RowColumnImpl.kt:463)
at androidx.compose.foundation.layout.IntrinsicMeasureBlocks$HorizontalMinHeight$1.invoke(RowColumnImpl.kt:462)
at androidx.compose.foundation.layout.RowColumnMeasurePolicy.minIntrinsicHeight(RowColumnImpl.kt:108)
```
**If dont use Row(Modifier.height(IntrinsicSize.Min)), or specifies size, it works fine**:
These 2 examples works fine and shows the image:
```
Row() {
GlideImage(
model = "https://javabog.dk/JSP-lille.jpg",
contentDescription = "Text",
)
}
Row(Modifier.height(IntrinsicSize.Min)) {
GlideImage(
model = "https://javabog.dk/JSP-lille.jpg",
contentDescription = "Text",
modifier = Modifier
.width(80.dp)
.height(80.dp)
)
}
```
Contributor guide
Assessment
This issue has not been assessed yet.