What's New
Cache Result Support
CompressionResult now supports caching the compressed image to disk via
cacheResult(). Once cached, the in-memory byte array is released to reduce memory
pressure.
CompressionResult.cacheResult()— writes bytes to a file and releases the in-memory
ByteArrayCompressionResult.cachedPath— returns the file path of the cached result, or
nullif not cachedCompressionResult.isBytesAvailable— indicates whether in-memory bytes are still
held- Accessing
.bytesafter caching throwsIllegalStateExceptionwith the cached file
path for guidance
Compress from File Path
Komig.compress() now accepts a filePath: String directly.
val result = Komig.compress("/path/to/image.jpg") {
quality(80)
format(OutputFormat.WEBP)
}New Exception Type
KomigException.FileIOException— thrown when a file cannot be read at the given
path