Releases: derangga/komig
Releases · derangga/komig
Release list
v0.1.1
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
Komig 0.1.0
Komig 0.1.0 — Initial Release
A Kotlin Multiplatform image compression library for Android and iOS.
Features
- Coroutine-based DSL — Simple, idiomatic API for image compression
- Multi-format support — JPEG, PNG, and WebP with automatic format detection via magic bytes
- Quality control — Configurable compression quality (0–100)
- Resize modes —
FitInside,ExactResize, andPercentagescaling - Max resolution — Cap output dimensions while preserving aspect ratio
- Platform-native codecs —
BitmapFactory/Bitmap.compresson Android,UIImage/UIKiton iOS - KMP targets — Android (minSdk 26), iOS (iosX64, iosArm64, iosSimulatorArm64)
Installation
// In commonMain
implementation("io.github.derangga:komig:0.1.0")Quick Start
val result = Komig.compress(imageBytes) {
quality(80)
format(OutputFormat.WEBP)
maxResolution(1920, 1080)
}
// result.bytes → compressed ByteArray
// result.outputSizeBytes → compressed size