Hello Everyone, I'm experiencing an issue with dis...
# compose
r
Hello Everyone, I'm experiencing an issue with displaying images in my Jetpack Compose project. When I use the
AsyncImage
composable to load images, a green line appears on the edges of images. However, this issue does not occur when I use
GlideImage
. For more reference, the issue image and code are added in this chat thread 🧵. Could anyone help, why this green line might be appearing and let me know if any soultion for this issue.?
Please find attached image where green lines appears. Here is the code snippet for the `AsyncImage`: @Composable fun *CustomAsyncImage*( modifier: Modifier = Modifier, customAsyncImageDisplay: CustomAsyncImageDisplay, ) { val request = ImageRequest.Builder(LocalContext.current) .data(eciAsyncImageDisplay.imageUrl) .decoderFactory(SvgDecoder.Factory()) .setHeader(_USER_AGENT_, _USER_AGENT_VALUE_) .setHeader(ACCEPT, _ACCEPT_IMAGE_FORMATS_) .diskCachePolicy(CachePolicy.ENABLED) .memoryCachePolicy(CachePolicy.ENABLED) .build() AsyncImage( model = request, contentDescription = customAsyncImageDisplay.contentDescription, contentScale = customAsyncImageDisplay.contentScale, error = painterResource(id = customAsyncImageDisplay.errorPlaceholder), modifier = _updateModifier_(customAsyncImageDisplay, modifier), ) } private fun *updateModifier*( customAsyncImageDisplay: CustomAsyncImageDisplay, modifier: Modifier, ): Modifier { return customAsyncImageDisplay.aspectRatio?.let { ratio -> customAsyncImageDisplay.shape?.let { shape -> modifier ._aspectRatio_(ratio) ._clip_(shape) } ?: modifier._aspectRatio_(ratio) } ?: customAsyncImageDisplay.shape?.let { modifier._clip_(it) } ?: modifier }
Screenshot 2024-06-26 at 4.08.32 PM.png