Skip to content

WebP image format load tile issue #114

@moisoni97

Description

@moisoni97

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. '

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions