StreamCdnImageResizer

fun interface StreamCdnImageResizer

Strategy for resizing Stream CDN hosted image URLs before they are loaded, to avoid downloading full-resolution originals. It is applied to image attachment URLs by the Compose and XML UI kits and configured via ChatTheme(streamCdnImageResizer = …) / ChatUI.streamCdnImageResizer.

Resizing is on by default at a 2MP cap (StreamCdnMaxPixelsImageResizer), matching the iOS SDK. Provide NoOpStreamCdnImageResizer to opt out, or implement this interface to apply a custom resizing strategy. Only Stream CDN hosted URLs that carry the original dimensions are affected; any other URL is returned unchanged.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun resizeUrl(imageUrl: String): String

Returns a (possibly) resized Stream CDN image URL for imageUrl.