Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoilAsyncZoomImage子采样失败,The thumbnail aspect ratio is different with the original image #22

Open
XDao7 opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@XDao7
Copy link

XDao7 commented Mar 14, 2024

Describe the bug

在使用子采样加载大图的时候,出现了缩略图加载成功,但是子采样失败的问题,log如下:

ZoomableState@9df97bfd. reset:contentScaleChanged. containerSize=522x457, contentSize=522x457, contentOriginSize=0x0, contentScale=Fit, alignment=Center, rotation=0, scalesCalculator=DynamicScalesCalculator(multiple=3.0), readMode=ReadMode(sizeType=3, decider=LongImageDecider(2.5:5.0)). lastContentVisibleCenter=261x228. minScale=1.0, mediumScale=3.0, maxScale=9.0, baseTransform=(1.0x1.0,0.0x0.0,0.0,0.0x0.0,0.5x0.5), userTransform=(1.0x1.0,0.0x0.0,0.0,0.0x0.0,0.0x0.0), transform=(1.0x1.0,0.0x0.0,0.0,0.0x0.0,0.5x0.5)
ZoomableState@9df97bfd. reset:alignmentChanged. All parameters unchanged
ZoomableState@9df97bfd. reset:readModeChanged. All parameters unchanged
ZoomableState@9df97bfd. reset:scalesCalculatorChanged. All parameters unchanged
ZoomableState@9df97bfd. reset:limitOffsetWithinBaseVisibleRectChanged. All parameters unchanged
SubsamplingState@9df97bfd. resetTileDecoder:contentSizeChanged. failed. imageSource=null, contentSize=522x457, 'null'
ZoomableState@9df97bfd. CoilZoomAsyncImage. onState. state=Success. data='http://10.52.12.232:30001/minio-server/zhihuiketang001dev/var/2024/0314/6b8b76ef-b741-47ea-983a-a86fe21c2b50.jpg'
SubsamplingState@9df97bfd. setImageSource. 'null' -> 'http://10.52.12.232:30001/minio-server/zhihuiketang001dev/var/2024/0314/6b8b76ef-b741-47ea-983a-a86fe21c2b50.jpg'
ZoomableState@9df97bfd. reset:contentSizeChanged. containerSize=522x457, contentSize=22x456, contentOriginSize=0x0, contentScale=Fit, alignment=Center, rotation=0, scalesCalculator=DynamicScalesCalculator(multiple=3.0), readMode=ReadMode(sizeType=3, decider=LongImageDecider(2.5:5.0)). lastContentVisibleCenter=261x228. minScale=1.0022, mediumScale=23.7273, maxScale=71.1818, baseTransform=(1.0x1.0,250.0x0.0,0.0,0.0x0.0,0.02x0.5), userTransform=(23.68x23.68,-5918.84x0.0,0.0,0.0x0.0,0.02x0.5), transform=(23.73x23.73,0.0x0.0,0.0,0.0x0.0,0.02x0.5)
SubsamplingState@9df97bfd. resetTileDecoder:contentSizeChanged. error, The thumbnail aspect ratio is different with the original image. contentSize: 22x456, ignoreExifOrientation=false. imageInfo: (1586x31416,'image/jpeg'). 'http://10.52.12.232:30001/minio-server/zhihuiketang001dev/var/2024/0314/6b8b76ef-b741-47ea-983a-a86fe21c2b50.jpg'
SubsamplingState@9df97bfd. resetTileManager:preferredTileSizeChanged. failed. imageSource=CoilImageSource('http://10.52.12.232:30001/minio-server/zhihuiketang001dev/var/2024/0314/6b8b76ef-b741-47ea-983a-a86fe21c2b50.jpg'), contentSize=22x456, preferredTileSize=261x228, tileDecoder=null, 'http://10.52.12.232:30001/minio-server/zhihuiketang001dev/var/2024/0314/6b8b76ef-b741-47ea-983a-a86fe21c2b50.jpg'

想问一下这种情况是图片参数有问题还是什么?可以提供一些帮助么?出问题的原图附在最后了。

Affected platforms

  • Android

Affected components

  • CoilAsyncZoomImage

Versions

  • zoomimage version*:1.0.2
  • Kotlin version*:1.9.0
  • Compose version(s)* (Jetpack/Multiplatform):compose-bom:2023.08.00, kotlinCompilerExtensionVersion '1.5.1'

Running Devices

  • 华为平板C3 BZH-W30 arm64-v8a

Sample code

val zoomState: ZoomState = rememberZoomState()
LaunchedEffect(Unit) {
    zoomState.zoomable.readMode = ReadMode.Default
}
CoilZoomAsyncImage(
    model = Uri.parse(afterWorkItem.question.getPrefixPath()),
    contentDescription = null,
    modifier = Modifier
        .padding(7.dp)
        .fillMaxSize(),
    state = zoomState
)

Screenshots

Screenshot_20240314_195550

Additional context

6b8b76ef-b741-47ea-983a-a86fe21c2b50

@XDao7 XDao7 added the bug Something isn't working label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant