fc_native_image_resize 0.14.2 copy "fc_native_image_resize: ^0.14.2" to clipboard
fc_native_image_resize: ^0.14.2 copied to clipboard

A Flutter plugin to resize images via native APIs.

fc_native_image_resize #

pub package

A Flutter plugin to resize images via native APIs.

iOS Android macOS Windows
Path   ❌ (See note below)
Uri -

Supported image formats:

  • Read
    • JPEG, PNG
    • Platform native image formats. e.g. HEIF/AVIF on iOS/macOS
  • Write
    • JPEG, PNG

NOTE on Windows: Starting from 0.9.0. Windows support has been removed. It's recommended to use the image package instead of native Windows APIs as the latter has limited support for image formats.

Usage #

final plugin = FcNativeImageResize();

try {
  /// Resizes the [srcFile] image with the given options and saves the results
  /// to [destFile].
  ///
  /// [srcFile] source image path.
  /// [srcFileUri] true if source image is a Uri (Android/iOS/macOS).
  /// [destFile] destination image path.
  /// [width] destination image width.
  /// Pass -1 to adjust width based on height (keepAspectRatio must be true).
  /// [height] destination image height.
  /// Pass -1 to adjust height based on width (keepAspectRatio must be true).
  /// [keepAspectRatio] if true, keeps aspect ratio.
  /// [format] destination file format. 'png' or 'jpeg'.
  /// [quality] only applies to 'jpeg' type, 1-100 (100 best quality).
  await plugin.resizeFile(
            srcFile: srcFile,
            destFile: destFile,
            width: 300,
            height: 300,
            keepAspectRatio: true,
            format: 'jpeg',
            quality: 90);
} catch (err) {
  // Handle platform errors.
}
8
likes
150
points
1.71k
downloads

Publisher

verified publisherflutter-cavalry.com

Weekly Downloads

A Flutter plugin to resize images via native APIs.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on fc_native_image_resize