platform_image_converter 2.1.3
platform_image_converter: ^2.1.3 copied to clipboard
A high-performance Flutter plugin for cross-platform image format conversion using native APIs.
2.1.3 #
- Fix a memory leak on iOS/macOS: the
CFDictionaryholding the JPEG/HEIC compression quality was created but never released, leaking one dictionary per lossy conversion. It is now released together with the surrounding arena. - Guarantee resize output is at least 1x1px. An extreme aspect ratio could round a dimension down to 0 (for example fitting a 4000x3 image to width 5), producing a zero-sized surface that the native encoders reject;
ResizeMode.calculateSizenow clamps both dimensions to a minimum of 1px across every resize mode and platform.
2.1.2 #
- Restore the
jnidependency to^1.0.0(and the Android bindings generated withjnigen0.16.0), reverting the temporary downgrade shipped in 2.1.1. Projects that also depend on packages still onjni0.15.x (such ascronet_http) will keep resolving to 2.1.1 automatically until those packages migrate.
2.1.1 #
- Downgrade the
jnidependency to^0.15.0(and regenerate the Android bindings withjnigen0.15.0) so this package can be used alongside packages that still depend onjni0.15.x, such ascronet_http. This is a temporary compatibility release; a future release will return tojni1.0.0 once the ecosystem has migrated.
2.1.0 #
- Add EXIF orientation handling via a new
orientationparameter onImageConverter.convert, controlled by theExifOrientationPolicyenum.apply(the default) bakes the source's EXIF orientation into the output pixels so the result is upright on every platform;ignoreencodes the decoded buffer as-is. Implemented on every backend: Darwin (CoreGraphics CTM), Android (ExifInterface+Matrix), Windows (IWICBitmapFlipRotator+ metadata query reader), Linux (gdk_pixbuf_apply_embedded_orientation), and Web (createImageBitmapimageOrientation). - Behavior change: because
applyis the default, the output of EXIF-tagged sources (typically camera JPEG/HEIC) now reflects the orientation tag instead of the raw decoded buffer. For a 90°/270° tag the output width and height swap, and the resize mode is evaluated against the oriented (display) dimensions. Passorientation: ExifOrientationPolicy.ignoreto keep the previous raw-buffer behavior.
2.0.0 #
- Breaking: unsupported-output and unsupported-platform conditions now throw exceptions from the
ImageConversionExceptionhierarchy instead of thedart:coreUnsupportedError, so a singleon ImageConversionExceptionclause catches every conversion failure and these recoverable conditions are no longer modelled as un-catchableErrors. A format that the platform cannot produce throwsUnsupportedFormatException, whosereasondistinguishes a permanent platform limitation (platformUnsupported, e.g. WebP on iOS/macOS/Windows or HEIC on Android/Web) from a codec that the user could install (codecUnavailable, e.g. Windows HEIC without the HEVC/HEIF codec). Running on a platform with no backend throwsUnsupportedPlatformException. Code that caughtUnsupportedErrormust now catch these types. - Add Windows support via the Windows Imaging Component (WIC), bound directly with
dart:ffi(no native build step). JPEG and PNG output are supported with the same resizing modes and quality control as the other platforms. HEIC output is also supported where the OS ships the HEVC/HEIF codec (Windows 11 22H2+ out of the box; older Windows via the Store "HEVC Video Extensions") — when absent, HEIC throwsUnsupportedFormatException. WebP output is not supported (Windows has a WebP decoder but no encoder). As on the Darwin backend, every source is normalized to a fixed 8-bit surface before encoding. - Add Linux support via GdkPixbuf (the GLib/GTK imaging stack the Flutter Linux embedder already links), bound directly with
dart:ffi(no native build step). JPEG and PNG output are always available; WebP and HEIC output require a writable GdkPixbuf loader module (e.g.webp-pixbuf-loader, or the libheif loader), which varies by distribution — when none is installed, output throwsUnsupportedFormatExceptionwith reasoncodecUnavailable. Resizing uses high-quality (GDK_INTERP_HYPER) resampling and quality control matches the other platforms.
1.2.1 #
- Web: render resizes with
imageSmoothingQuality = 'high'so downscaled output quality matches the iOS/macOS (kCGInterpolationHigh) and Android (filter: true) backends.
1.2.0 #
- Upgrade the
jnidependency to^1.0.0and regenerate the Android bindings withjnigen0.16.0. The minimumjniversion is now 1.0.0 (previously 0.15.2); this major bump of a direct dependency may affect dependency resolution for consumers that also depend onjni.
1.1.0 #
- Fix iOS/macOS crash when resizing 16-bit, grayscale, CMYK, or indexed images (#36).
- Normalize iOS/macOS output to 8-bit sRGB. 16-bit and wide-gamut (e.g. Display P3) sources are no longer preserved, and output no longer depends on whether a resize occurred (behavior change).
- Drop the
objective_cdependency on iOS/macOS; the native backend now binds CoreFoundation/CoreGraphics/ImageIO directly viadart:ffi.
1.0.6 #
- Fix lint rule.
1.0.5 #
- Fix exclude rule.
1.0.4 #
- Fix lint rules.
- Fix documentations.
- Fix resource management.
1.0.3 #
- Fix support flutter version constraint.
- Fix documentations.
- Update integration test.
1.0.2 #
- dart format applied to all files.
1.0.1 #
- Fix pubspec.ymml and .metadata files.
1.0.0 #
- Initial stable release.
- Add
ImageConversionExceptionfor better error handling. - Improve documentation and add usage examples.
0.2.0 #
- Support resized image output.
- Refactor codebase for better maintainability.
0.1.0 #
- Initial release of platform_image_converter.
- Support Android, iOS, macOS, and Web.
- Add
convertmethod for image format conversion.