zoomimage icon indicating copy to clipboard operation
zoomimage copied to clipboard

WebP image format load tile issue

Open moisoni97 opened this issue 3 months ago • 2 comments

I have a subsampling issue only when using the .webp format. The same image, but exported as .jpg, works. Image size: 4096x4096 px. The problem seems to happen only on my real device.

Update1: I notice it also happens only in portrait mode. If I use the phone in landscape mode, there is no issue.

Tested on: Real device: Samsung Galaxy S22 Ultra (Android 15) - Not working Emulator: Pixel 9a (Android 16) - Working, no issues. Emulator: iPhone 16e (iOS 26) - Working, no issues.

If I zoom-in the image and then start to scroll, some tiles will fail to load and will display the placeholder instead. From this state, if I zoom-out entirely and then zoom back in to the previously failed-to-load tile, then it loads, but at a lower quality than the tile next to it.

Image Image

Code snippet:

               val zoomState = rememberZoomState(
                    logLevel = Logger.Level.Verbose
                )

                val imageSource = remember {
                    val resUri = Res.getUri("files/map_vikendi.webp")
                    ImageSource.fromComposeResource(resUri)
                }
                zoomState.setSubsamplingImage(imageSource)

                ZoomImage(
                    modifier = Modifier.fillMaxSize(),
                    painter = painterResource(Res.drawable.filter_all),
                    contentDescription = null,
                    zoomState = zoomState
                )

Logcat:

TileManager. loadTile. failed, size is different. Tile(coordinate=1x1,srcRect=[683x1366,1366x2732],srcSize=683x1366,state=ERROR,from=UNKNOWN,sampleSize=1,bitmap=null). android.graphics.Bitmap@1b8e546. '

moisoni97 avatar Sep 30 '25 10:09 moisoni97

  1. Post the original image
  2. What are the test results of other real devices other than Samsung?

panpf avatar Nov 07 '25 02:11 panpf

  1. This is the original image: Image

  2. Unfortunately, I don't have any other phones other than my Samsung.

Update: I managed to get a Samsung Galaxy S10+, and with this device, it works great, no issues.

moisoni97 avatar Nov 07 '25 19:11 moisoni97