# flutter_image_compress 2.5.1

Compress Pictures. Can effectively reduce the size of the transmission.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add flutter_image_compress
```
Published: 2026-07-25T13:02:06.533259Z
Expected archive SHA-256: 98a48c05a7add6869c6838270e862124a4d571f9dd5d0cf209ed03a71b20ea84

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- flutter_image_compress_common: ^1.1.1
- flutter_image_compress_macos: ^1.1.0
- flutter_image_compress_ohos: ^0.0.3+1
- flutter_image_compress_platform_interface: ^1.1.0
- flutter_image_compress_web: ^0.1.5+1

## Package README (untrusted upstream documentation)
# flutter_image_compress

[![ImageCompress](https://img.shields.io/badge/fluttercandies-ImageCompress-blue.svg)](https://github.com/fluttercandies/flutter_image_compress)
[![pub package](https://img.shields.io/pub/v/flutter_image_compress.svg)](https://pub.dartlang.org/packages/flutter_image_compress)
[![GitHub license](https://img.shields.io/github/license/fluttercandies/flutter_image_compress?style=flat-square)](https://github.com/fluttercandies/flutter_image_compress/blob/main/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/fluttercandies/flutter_image_compress.svg?style=social&label=Stars)](https://github.com/fluttercandies/flutter_image_compress)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://stackoverflow.com/questions/tagged/flutter?sort=votes)
[![FlutterCandies](https://pub.idqqimg.com/wpa/images/group.png)](https://jq.qq.com/?_wv=1027&k=5bcc0gy)

A Flutter plugin that compresses images using native code (Kotlin on Android, Objective-C/Swift on Apple platforms). Supported platforms: Android, iOS, macOS, Web, OpenHarmony.

<details>
<summary>Table of contents</summary>

- [Why native instead of Dart?](#why-native-instead-of-dart)
- [Platform features](#platform-features)
- [Usage](#usage)
- [Common parameters](#common-parameters)
  - [minWidth and minHeight](#minwidth-and-minheight)
  - [rotate](#rotate)
  - [autoCorrectionAngle](#autocorrectionangle)
  - [quality](#quality)
  - [format](#format)
    - [WebP](#webp)
    - [HEIF / HEIC](#heif--heic)
  - [inSampleSize](#insamplesize)
  - [keepExif](#keepexif)
- [Return values](#return-values)
  - [Working with `List<int>` and `Uint8List`](#working-with-listint-and-uint8list)
- [FAQ](#faq)
- [Runtime errors](#runtime-errors)
- [Android](#android)
- [Troubleshooting](#troubleshooting)
- [EXIF metadata](#exif-metadata)
- [Web](#web)
- [macOS](#macos)
- [OpenHarmony](#openharmony)

</details>

## Why native instead of Dart?

Dart-only image libraries exist, but in practice they are too slow for typical compression workloads — even in release builds, and even when moved to an `Isolate`. Delegating to platform-native encoders is dramatically faster.

## Platform features

| Feature                    | Android |  iOS  |           Web           | macOS | OpenHarmony |
| :------------------------- | :-----: | :---: | :---------------------: | :---: | :---------: |
| `compressWithList`         |    ✅   |   ✅   |            ✅            |   ✅   |      ✅      |
| `compressAssetImage`       |    ✅   |   ✅   |            ✅            |   ✅   |      ✅      |
| `compressWithFile`         |    ✅   |   ✅   |            ❌            |   ✅   |      ✅      |
| `compressAndGetFile`       |    ✅   |   ✅   |            ❌            |   ✅   |      ✅      |
| Format: jpeg               |    ✅   |   ✅   |            ✅            |   ✅   |      ✅      |
| Format: png                |    ✅   |   ✅   |            ✅            |   ✅   |      ✅      |
| Format: webp               |    ✅   |   ✅   | [🌐][webp-compatibility] |   ❌   |      ✅      |
| Format: heic               |    ✅   |   ✅   |            ❌            |   ✅   |      ✅      |
| Param: `quality`           |    ✅   |   ✅   | [🌐][webp-compatibility] |   ✅   |      ✅      |
| Param: `rotate`            |    ✅   |   ✅   |            ❌            |   ✅   |      ✅      |
| Param: `keepExif`          |    ✅   |   ✅   |            ❌            |   ✅   |      ❌      |

[webp-compatibility]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#browser_compatibility "Browser support"


## Usage

Add the [latest version](https://pub.dev/packages/flutter_image_compress/versions) to your `pubspec.yaml`:

```yaml
dependencies:
  flutter_image_compress: <latest_version>
```

Or run:

```bash
flutter pub add flutter_image_compress
```

Import it in your Dart code:

```dart
import 'package:flutter_image_compress/flutter_image_compress.dart';
```

The plugin exposes four entry points depending on your input and desired output. See the [full example](https://github.com/fluttercandies/flutter_image_compress/blob/main/packages/flutter_image_compress/example/lib/main.dart) for a runnable version.

```dart
// 1. Compress a file, get bytes back.
Future<Uint8List?> testCompressFile(File file) async {
  final result = await FlutterImageCompress.compressWithFile(
    file.absolute.path,
    minWidth: 2300,
    minHeight: 1500,
    quality: 94,
    rotate: 90,
  );
  print(file.lengthSync());
  if (result != null) {
    print(result.length);
  }
  return result;
}

// 2. Compress a file, get a file back.
Future<File?> testCompressAndGetFile(File file, String targetPath) async {
  final result = await FlutterImageCompress.compressAndGetFile(
    file.absolute.path,
    targetPath,
    quality: 88,
    rotate: 180,
  );

  print(file.lengthSync());
  if (result != null) {
    print(await result.length());
    return File(result.path);
  }
  return result;
}

// 3. Compress an asset image, get bytes back.
Future<Uint8List?> testCompressAsset(String assetName) async {
  return FlutterImageCompress.compressAssetImage(
    assetName,
    minHeight: 1920,
    minWidth: 1080,
    quality: 96,
    rotate: 180,
  );
}

// 4. Compress bytes, get bytes back.
Future<Uint8List> testCompressList(Uint8List list) async {
  final result = await FlutterImageCompress.compressWithList(
    list,
    minHeight: 1920,
    minWidth: 1080,
    quality: 96,
    rotate: 135,
  );
  print(list.length);
  print(result.length);
  return result;
}
```

## Common parameters

### minWidth and minHeight

`minWidth` and `minHeight` bound the output size while preserving the source aspect ratio. See the [FAQ entry below](#why-is-minwidthminheight-named-that-if-it-acts-like-a-max) for why the names are misleading.

Given a 4000×2000 image with `minWidth: 1920, minHeight: 1080`, the scale is computed like this:

```dart
// Illustrative Dart port of the native logic.
import 'dart:math' as math;

void main() {
  final scale = calcScale(
    srcWidth: 4000,
    srcHeight: 2000,
    minWidth: 1920,
    minHeight: 1080,
  );

  print('scale = $scale'); // 1.8518518518518519
  print('target = ${4000 / scale} × ${2000 / scale}'); // 2160.0 × 1080.0
}

double calcScale({
  required double srcWidth,
  required double srcHeight,
  required double minWidth,
  required double minHeight,
}) {
  final scaleW = srcWidth / minWidth;
  final scaleH = srcHeight / minHeight;
  return math.max(1.0, math.min(scaleW, scaleH));
}
```

If the source is already smaller than `minWidth` or `minHeight`, the scale is clamped to `1` — the image is never upscaled.

### rotate

Rotates the output by the given number of degrees. Set to `0` to skip rotation.

### autoCorrectionAngle

Available since 0.5.0. When `true` (the default), the plugin reads the source's EXIF orientation and rotates so the output is upright.

If you also pass a non-zero `rotate` value, the two can compound. To avoid double rotation, either set `rotate: 0` or `autoCorrectionAngle: false`.

### quality

Target quality, `0`–`100`. Ignored for PNG on iOS (PNG is lossless there).

### format

Chosen via the `CompressFormat` enum. Defaults to JPEG. JPEG and PNG work everywhere; WebP and HEIC have platform caveats — see below.

#### WebP

- **Android**: uses the system encoder, which is fast.
- **iOS**: encoded via [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder). Functional, but noticeably slower than the other formats. Swapping to Google's `libwebp` directly would help but is not currently on the roadmap.
- **macOS**: not supported.
- **Web**: depends on the browser's Canvas `toBlob` implementation; see the compatibility link in the table above.

#### HEIF / HEIC

- **iOS**: iOS 11+ only.
- **Android**: API 28+ only, and requires a working hardware encoder. Not every API 28+ device qualifies — always wrap the call in try/catch and fall back to JPEG on `UnsupportedError`. Implemented on top of [`HeifWriter`][heifwriter].

[heifwriter]: https://developer.android.com/reference/androidx/heifwriter/HeifWriter.html

### inSampleSize

Android only. Passed directly to `BitmapFactory.Options`; see the [Android documentation](https://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize) for its exact semantics.

### keepExif

When `true`, source EXIF metadata is copied onto the compressed output. Defaults to `false`.

A few caveats apply regardless of platform or format:

1. The `Orientation` tag is always normalized to `1` / `ORIENTATION_NORMAL`. The pipeline bakes any rotation into the pixels, so preserving the source orientation would cause viewers to rotate a second time.
2. Support depends on both the output format **and** the platform:

   | Output format | iOS / macOS | Android |
   | --- | --- | --- |
   | JPEG | ✅ Full sub-dict passthrough (EXIF, TIFF, GPS, IPTC, PNG) | ✅ ~90 tags via `androidx.exifinterface` |
   | PNG  | ✅ Same passthrough | ✅ ~90 tags via `androidx.exifinterface` |
   | WebP | ❌ ImageIO cannot author WebP metadata; output is a valid WebP with no EXIF | ✅ ~90 tags via `androidx.exifinterface` |
   | HEIC | ✅ Same passthrough | ❌ `androidx.exifinterface` refuses HEIF writes; output is a valid HEIC with no EXIF. `HeifHandler` logs a warning. |

3. Unsupported combinations still return valid image bytes — you simply do not get EXIF back. `keepExif: true` never fails the compression call as a whole.

##### Known gaps (tracked in [#130](https://github.com/fluttercandies/flutter_image_compress/issues/130))

- **iOS WebP + `keepExif`**: ImageIO cannot write metadata into a WebP container. A manual VP8X + EXIF chunk splice via `SDWebImageWebPCoder` would fix this but is not implemented.
- **Android HEIC + `keepExif`**: `androidx.exifinterface` refuses HEIF writes on every version. Manually injecting ISO/IEC 23008-12 metadata boxes (~400 LoC) would fix this but is not implemented.
- **Web / OpenHarmony `keepExif`**: the Canvas / packing pipelines strip metadata at encode time — no in-tree fix path exists.

## Return values

APIs that return a `List<int>` never return `null` — they return an empty list when compression fails.

APIs that return a file may return `null`. The file may also be missing on disk even when a value is returned, so verify existence before using it.

### Working with `List<int>` and `Uint8List`

You'll often need to convert `List<int>` to `Uint8List` to display the result:

```dart
final image = Uint8List.fromList(imageList);
final ImageProvider provider = MemoryImage(image);
```

Import `dart:typed_data` (or `flutter/foundation.dart`) to get `Uint8List`:

![img](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190519111735.png)

Displaying the result in an `Image` widget:

```dart
Future<Widget> _compressImage() async {
  final List<int> image = await testCompressFile(file);
  final ImageProvider provider = MemoryImage(Uint8List.fromList(image));
  return Image(image: provider);
}
```

Writing the result to disk:

```dart
Future<void> writeToFile(List<int> image, String filePath) {
  return File(filePath).writeAsBytes(image, flush: true);
}
```

## FAQ

### Compressing to a target file size

Neither `quality` (0–100, lossy) nor `minWidth`/`minHeight` (max output dimensions) maps linearly to output bytes. If you need to hit a specific size limit, iterate:

```dart
Future<Uint8List> compressToUnder(Uint8List src, int limitBytes) async {
  var quality = 88;
  var out = src;
  while (quality > 10) {
    out = await FlutterImageCompress.compressWithList(
      src,
      quality: quality,
      minWidth: 1920,
      minHeight: 1920,
    );
    if (out.lengthInBytes <= limitBytes) return out;
    quality -= 10;
  }
  return out;
}
```

For very small targets, shrink `minWidth`/`minHeight` as well once the quality loop bottoms out — pixel count is usually the biggest lever on file size.

### Why is `minWidth`/`minHeight` named that if it acts like a max?

Historical name we're stuck with. In practice they are **aspect-preserving upper bounds** on the output: the pipeline scales down (never up) so both dimensions fit inside the given box while keeping the source aspect ratio. Examples:

- Source 4032×3024, `minWidth: 1920, minHeight: 1920` → output ~1920×1440.
- Source 1000×1000, `minWidth: 500, minHeight: 500`   → output 500×500.
- Source 800×600,  `minWidth: 1920, minHeight: 1080`  → output 800×600 (no upscale).

The aspect ratio is always preserved (never cropped); only the scale is adjusted.

### The compressed image is larger than the original

Two common causes:

- **Re-encoding PNG as PNG.** PNG is lossless — re-encoding rarely shrinks it unless you also downscale. `quality` has no effect on PNG in the underlying encoders; the same DEFLATE runs either way. If the source was already tightly encoded (e.g. via `pngcrush`), the output can be a few percent larger.
- **`minWidth`/`minHeight` larger than the source.** The plugin won't upscale, but re-encoding still runs and may produce a slightly larger file than the input.

If the source is already small enough, skip the call when `src.lengthInBytes` is below your threshold rather than always compressing.

### Calling from a background isolate / `compute()`

Platform channels don't work in a background isolate unless you initialize its binary messenger first. Inside the isolate:

```dart
BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken);
final out = await FlutterImageCompress.compressWithList(bytes, quality: 80);
```

Obtain `rootIsolateToken` on the main isolate via `RootIsolateToken.instance!` and pass it in through the isolate's arguments.

Without this step you'll see an `UnimplementedError` pointing back here — that's the platform interface's `UnsupportedFlutterImageCompress` fallback firing.

### Which platforms support which formats?

Full matrix in [Platform features](#platform-features). Quick reference:

- **JPEG / PNG**: everywhere.
- **WebP**: Android + iOS + macOS via SDWebImageWebPCoder, Web via the browser (quality support varies).
- **HEIC / HEIF**: iOS 11+ and Android API 28+ with a hardware encoder — throws `UnsupportedError` otherwise. Not on macOS.

### How do I clear the temp files the plugin creates?

`compressAndGetFile` writes to the `targetPath` you pass. Everything else lands in the OS cache directory (`context.cacheDir` on Android, `NSTemporaryDirectory()` on iOS). Both are OS-managed; if you want manual cleanup, use [`path_provider`](https://pub.dev/packages/path_provider)'s `getTemporaryDirectory()` and clear it yourself.

## Runtime errors

Format and platform support vary, so any API may throw `UnsupportedError` on a device that can't produce the requested format. If you rely on WebP or HEIC, catch it and fall back to JPEG:

```dart
Future<Uint8List> compressAndTryCatch(String path) async {
  try {
    return await FlutterImageCompress.compressWithFile(
      path,
      format: CompressFormat.heic,
    );
  } on UnsupportedError catch (e) {
    print(e);
    return FlutterImageCompress.compressWithFile(
      path,
      format: CompressFormat.jpeg,
    );
  }
}
```

## Android

Requires Kotlin `1.5.21` or higher.

## Troubleshooting

### Compressing returns `null`

Usually a filesystem issue. Check that:

- Your process can read the source file and write to the target path.
- The parent directory of the target path exists.
- You've requested any permissions the platform needs (e.g. SD-card access on Android).

Use [`path_provider`](https://pub.dev/packages/path_provider) to obtain writable app directories, and a permission plugin for runtime storage permissions.

## EXIF metadata

By default (`keepExif: false`), the compressed output carries no source EXIF — only the minimum the container encoder injects (image dimensions, color space, and so on).

With `keepExif: true`, the plugin copies source EXIF onto the output. The [keepExif section](#keepexif) has the full per-format, per-platform matrix. In short:

- **iOS + macOS**: full sub-dict passthrough (EXIF, TIFF, GPS, IPTC, PNG chunks) via `CGImageSource → CGImageDestination`. Works for JPEG, PNG, HEIC. Not WebP — ImageIO cannot author WebP metadata.
- **Android**: ~90-tag copy via `androidx.exifinterface`. Works for JPEG, PNG, WebP. Not HEIC — `ExifInterface` refuses HEIF writes and `HeifHandler` logs a warning.
- **Web + OpenHarmony**: not supported. The Canvas / packing pipelines strip metadata at encode time.

Regardless of platform, the `Orientation` tag is always normalized to `1` / `ORIENTATION_NORMAL` on the output — the pipeline bakes rotation into pixels, so preserving the source orientation would cause viewers to rotate a second time.

### Encoders in use

- **JPEG / PNG**: system APIs on every platform.
- **WebP**: system API on Android; [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) on iOS; browser Canvas on Web.
- **HEIC / HEIF**: ImageIO on iOS 11+; [HeifWriter](https://developer.android.com/jetpack/androidx/releases/heifwriter) on Android API 28+ with a hardware encoder (throws `UnsupportedError` when the device can't encode HEIC).

## Web

The web implementation is optional — most consumers don't need it. It relies on the browser's Canvas `toBlob`, so format and quality support depend on the browser (see the compatibility link in the [Platform features](#platform-features) table).

## macOS

Requires a minimum deployment target of macOS 10.15. To update an existing app:

1. Open the Xcode project, select the **Runner** target, and set **macOS Deployment Target** to `10.15`.
2. Update `Podfile` to `platform :osx, '10.15'`.

## OpenHarmony

Decoding supports JPEG, PNG, GIF, RAW, WebP, BMP, and SVG. Encoding output is currently limited to JPEG, PNG, and WebP.

当前支持的解析图片格式包括 JPEG、PNG、GIF、RAW、WebP、BMP、SVG。编码输出图片格式当前仅支持 JPEG、PNG 和 WebP。

## Changelog
## 2.5.1

 - **FIX**(Android): handle Gradle 9 Kotlin modes safely ([#401](https://github.com/fluttercandies/flutter_image_compress/issues/401)). ([e4bbccae](https://github.com/fluttercandies/flutter_image_compress/commit/e4bbccaefd8243ecff9be1226d926bafba536108))

## 2.5.0

 - **REFACTOR**(common): drop go-flutter plugin, rebuild example native shell ([#368](https://github.com/fluttercandies/flutter_image_compress/issues/368)). ([6d3898b0](https://github.com/fluttercandies/flutter_image_compress/commit/6d3898b0ab1330f4d7679ab156478f70f5034cd6))
 - **FIX**(Android): preserve source EXIF on PNG and WebP output (refs [#130](https://github.com/fluttercandies/flutter_image_compress/issues/130)) ([#395](https://github.com/fluttercandies/flutter_image_compress/issues/395)). ([4ddf1390](https://github.com/fluttercandies/flutter_image_compress/commit/4ddf1390c6fa9ef171c3c07ffb0498529bfdb455))
 - **FIX**(iOS): preserve full source metadata on keepExif=true via direct CGImage passthrough ([#168](https://github.com/fluttercandies/flutter_image_compress/issues/168)) ([#391](https://github.com/fluttercandies/flutter_image_compress/issues/391)). ([2d6b7fe4](https://github.com/fluttercandies/flutter_image_compress/commit/2d6b7fe4b190de00e3cc298f81eb63361675d35e))
 - **FIX**(dart): reject compressAndGetFile when source == target ([#240](https://github.com/fluttercandies/flutter_image_compress/issues/240)) ([#386](https://github.com/fluttercandies/flutter_image_compress/issues/386)). ([c1dbe754](https://github.com/fluttercandies/flutter_image_compress/commit/c1dbe754b8b441f8885343451ff7353bca6f9d78))
 - **FIX**(iOS): don't crash on WebP + keepExif when ImageIO can't rewrite metadata ([#369](https://github.com/fluttercandies/flutter_image_compress/issues/369)). ([46e59a4b](https://github.com/fluttercandies/flutter_image_compress/commit/46e59a4b145659e2fab348e1e381ae8b80e60f94))
 - **FEAT**(darwin): migrate to Swift Package Manager ([#323](https://github.com/fluttercandies/flutter_image_compress/issues/323)). ([a77d6c49](https://github.com/fluttercandies/flutter_image_compress/commit/a77d6c49e5118e8990b75a2a8bf6f9e869b8ccd9))
 - **DOCS**(Android): surface HEIC + keepExif limitation via Log.w + README matrix (refs [#130](https://github.com/fluttercandies/flutter_image_compress/issues/130)) ([#394](https://github.com/fluttercandies/flutter_image_compress/issues/394)). ([3d47a609](https://github.com/fluttercandies/flutter_image_compress/commit/3d47a6094d952a560fa90d1d0889e700f902a454))

## 2.4.0

 - **FEAT**: remove pica from web ([#324](https://github.com/fluttercandies/flutter_image_compress/issues/324)). ([b56ce0fa](https://github.com/fluttercandies/flutter_image_compress/commit/b56ce0fa4763bf8084c26ea8e435e37e06997ba8))

## 2.3.0

 - **FEAT**: Update plugin structure for OpenHarmony ([#301](https://github.com/fluttercandies/flutter_image_compress/issues/301)). ([5e999c43](https://github.com/fluttercandies/flutter_image_compress/commit/5e999c431c5dcff880b8c217e40fa7d027ca0bdc))

## 2.2.0

 - **FEAT**: support openharmony ([#290](https://github.com/fluttercandies/flutter_image_compress/issues/290)). ([e9f10b28](https://github.com/fluttercandies/flutter_image_compress/commit/e9f10b28e089539fe7319d7bc1779b9a2c209fc4))
 - **DOCS**: The first version for OpenHarmony. ([5fcab8da](https://github.com/fluttercandies/flutter_image_compress/commit/5fcab8dac6277b36b7169962474e5af3cf88724b))

## 2.1.0

 - **FEAT**: support macOS ([#264](https://github.com/fluttercandies/flutter_image_compress/issues/264)). ([06ab91ed](https://github.com/fluttercandies/flutter_image_compress/commit/06ab91ed470ea2c838daeb6c654ad06dadc99f1d))
 - **DOCS**: Update README ([#266](https://github.com/fluttercandies/flutter_image_compress/issues/266)). ([235643ab](https://github.com/fluttercandies/flutter_image_compress/commit/235643ab0be9c9a39083031d9ab9de06a74241f3))
 - **DOCS**: Update README. ([1e232a10](https://github.com/fluttercandies/flutter_image_compress/commit/1e232a10c84743ab3c35e1bffda5730801506891))
 - **DOCS**: Update changelog. ([c847f5d5](https://github.com/fluttercandies/flutter_image_compress/commit/c847f5d5d03d4e727b1a83dd33e54d8d93787749))

## 2.0.4

 - **DOCS**: Update changelog. ([c847f5d5](https://github.com/fluttercandies/flutter_image_compress/commit/c847f5d5d03d4e727b1a83dd33e54d8d93787749))

## 2.0.3

- Bump dependencies version.
- Change sdk constraint to `>=2.12.0 <4.0.0`.

## 2.0.2

- Config default_plugin for web in pubspec.yaml.

## 2.0.1

- Include web support.

## 2.0.0

- Migrate platform interface

**Breaking** Change:

- The result `File` to `XFile` of [cross_file](https://pub.dev/packages/cross_file)

See the [migration guide](https://github.com/fluttercandies/flutter_image_compress/blob/main/migrate.md) for more details.

## 1.1.3

- Fix converting from WebP causes app crash on iOS. (#222).

## 1.1.2

- Fix crashes on iOS with nil data. (#220)
- Adapt Flutter 3.3.

## 1.1.1

- Merge effective PRs that improve the plugin from various aspects, including:
  #192, #207, #208, #210, #214. Thanks to these contributors.
- Repo cleanup.

## 1.1.0

- Add SDWebImage dependency for iOS. (#182)
- Repo cleanup.

## 1.0.0

Modify the constraint version of flutter to 2.0.0

## 1.0.0-nullsafety

Migrate null-safety version.

## 0.7.0

- Fix memory leaked for android.
- Support android v2 plugin.

**Breaking Change**:

- Replace `List<int>` to `Uint8List`.

## 0.6.8

- Update `Validate` code.

## 0.6.7

Use the async GCD in iOS.

## 0.6.6

- [#116](https://github.com/fluttercandies/flutter_image_compress/pull/116)
- [#124](https://github.com/fluttercandies/flutter_image_compress/pull/124)

## 0.6.5+1

Fix:

- Web format error
- Import header error for iOS.

## 0.6.5

New feature

- Support webp on iOS.

## 0.6.4

New feature:

- Add Params inSampleSize for methods.
- Heif and webp Partially supported.

## 0.6.3

Fix:

- Android: When the register of the calling plugin is not in the main process or there is no Activity.

## 0.6.2

Optimization:

- Reduce the speed required for ios to add dependencies by copying the `SYPictureMetadata` source code into the project.

## 0.6.1

Fix:

- autoCorrectionAngle switches image width and height.

New feature:

- Keep exif (no have orientation), use `keepExif`

## 0.6.0

**BREAKING CHANGE** :

- remove method `getImageInfo`.

For the time being, the follow-dev branch is no longer used, but only the master branch is needed to unify the pub version number.

New Feature:

- It is now supported to set the compression target to png format.

## 0.5.2

Fix:

- [#49](https://github.com/fluttercandies/flutter_image_compress/issues/49): A problem of reading Exif information.

## 0.5.1

Change `reportError` with flutter stable version.

**Breaking Change:**
The autoCorrectionAngle parameter causes a number of situations to behave differently than `0.4.0`. See readme for details.

## 0.5.0

(don't use)

**Breaking Change:**
Because `FlutterError.reportError` method's param `context` type changed.
So this library will add the constraints of flutter SDK so that users before 1.5.9 will not use version 0.5.0 incorrectly.

## 0.4.0

Some code has been added to ensure that parameters that do not pass in native do not trigger crash.

## 0.3.1

Fix:

- Android close file output stream.

## 0.3.0

Fix:

- optimize compress scale.

## 0.2.4

Updated Kotlin version

**Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
migrate](https://developer.android.com/jetpack/androidx/migrate) if they're
using the original support library.

## 0.2.3

change iOS return type

## 0.2.2

add some dart doc

## 0.2.1

update readme

## 0.2.0

The version number is updated so that people who can use the higher version of gradle can use it. see pr #8

if android run error, you must update your kotlin's version to 1.2.71+

## 0.1.4

add optional params rotate

fix bug

update example

## 0.1.3

fix the ios `flutter.h` bug

## 0.1.1

update readme

## 0.1.0

first version







 
