Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Bitmap.compressToInternal() not working #540

@phileo

Description

@phileo

I am trying to capture map rendering as a Bitmap using the following code snippet:

com.carto.ui.MapView.mapRenderer.captureRendering(object : RendererCaptureListener() {
            override fun onMapRendered(bitmap: com.carto.graphics.Bitmap) {
                super.onMapRendered(bitmap)
                val bitmapFile = File(context.applicationContext.filesDir, "bitmap.bmp")
                ByteArrayInputStream(bitmap.compressToPNG().data).copyToFile(bitmapFile)
            }

        }, true)

The above code snippet works and provides a PNG file.

However, if I replace compressToPNG() with compressToInternal(), then the above capture fails and the resulting file cannot be opened.

Any ideas as to why compressToInternal() is not working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions