sketch
sketch copied to clipboard
Resize webp not working on ios
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)
}
}
}
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