sketch icon indicating copy to clipboard operation
sketch copied to clipboard

Resize webp not working on ios

Open HungTD-Apero opened this issue 7 months ago • 1 comments

As the title, the ios implementation's resize on animated webp doesn't have any effect on my ios devices. android work fine. Here's the snippet:

@Composable
fun WebpItem(modifier: Modifier = Modifier, shouldShow: Boolean, url: String?, thumbnailUrl: String){
    val context = LocalPlatformContext.current
    BoxWithConstraints {
        val imageRequest = ComposableImageRequest(context, url) {
            cacheDecodeTimeoutFrameCommon(true)
            resize(10, 10, Precision.EXACTLY, Scale.CENTER_CROP)
            memoryCachePolicy(CachePolicy.ENABLED)
            downloadCachePolicy(CachePolicy.ENABLED)
            resultCachePolicy(CachePolicy.ENABLED)
            components {
                addDecodeInterceptor(delayDecodeInterceptor(300))
            }
        }

        val thumbRequest = ComposableImageRequest(context, thumbnailUrl){
            resize(10, 10, Precision.EXACTLY, Scale.CENTER_CROP)
            memoryCachePolicy(CachePolicy.ENABLED)
            downloadCachePolicy(CachePolicy.ENABLED)
            resultCachePolicy(CachePolicy.ENABLED)
        }

        AsyncImage(thumbRequest, contentDescription = null, modifier = modifier, contentScale = ContentScale.Crop, filterQuality = FilterQuality.Low)
        if (shouldShow) {
            AsyncImage(imageRequest, contentDescription = null, modifier = modifier, contentScale = ContentScale.Crop, filterQuality = FilterQuality.Low)
        }
    }
}

HungTD-Apero avatar May 29 '25 08:05 HungTD-Apero

Yes, this is the expected result. https://github.com/panpf/sketch/blob/637339026b23a21b997e909823ec480ff6a56da3/sketch-animated-core/src/nonAndroidMain/kotlin/com/github/panpf/sketch/decode/internal/SkiaAnimatedDecoder.kt#L53

panpf avatar Jun 13 '25 06:06 panpf