image_compressor 0.1.0
image_compressor: ^0.1.0 copied to clipboard
Compress images to a target file size in Flutter — one call to get an image under X KB. Native speed, zero-config web, automatic orientation and large-image handling.
0.1.0 #
Initial release.
ImageCompressor.toSize(input, maxBytes:)— compress to a target file size. The quality search runs natively (decode once), so it stays fast on large images. ReturnsreachedTarget+usedQualityinstead of throwing when a size can't be met.ImageCompressor.toQuality(input, quality:)— fixed-quality mode.toSizeAll/toQualityAll— batch with boundedconcurrency,onProgress, andCancelTokensupport.- Any input via
ImageSource— bytes, file path, asset key, or anXFilestraight fromimage_picker. CompressedImage.saveTo(path)extension (native only).- Automatic EXIF orientation (
autoOrient), decode-time downsampling to avoid OOM on large images, and consistent per-edge resize across platforms. - Formats: JPEG/PNG everywhere, WebP on Android + web, HEIC on iOS.
- Platforms: Android, iOS, Web.
- Never returns
null— hard failures throw a typedCompressError.