media_reduce 0.1.0
media_reduce: ^0.1.0 copied to clipboard
Iteratively compresses images and videos toward a maximum byte budget on Android and iOS, so files fit API upload limits before sending.
Changelog #
0.1.0 #
Initial release.
- Iterative target-size reduction for images and videos via
MediaReduce.reduceToMaxBytes(ReductionRequest). - Image pipeline: native JPEG re-encode with EXIF orientation handling,
optional max-width/height, binary search on quality (Android:
BitmapFactoryandroidx.exifinterface; iOS:ImageIO+UIGraphicsImageRenderer).
- Video pipeline: native bitrate-controlled H.264 transcode with binary
search on bitrate (Android: Media3
Transformer+VideoEncoderSettings; iOS:AVAssetReader+AVAssetWriterwithAVVideoAverageBitRateKey). MediaInfolookup (getMediaInfo) and temp-cache cleanup (clearCache).- Progress callback exposing per-attempt size, stage label and target.
- Clean architecture: domain entities,
NativeMediaGatewayport, method-channel adapter, dependency-injectable use case for tests.