commit
d1fec905fc
|
|
@ -1,5 +1,7 @@
|
||||||
# platform_image_converter
|
# platform_image_converter
|
||||||
|
|
||||||
|
[](https://pub.dev/packages/platform_image_converter)
|
||||||
|
|
||||||
A high-performance Flutter plugin for cross-platform image format conversion and resizing using native APIs on iOS, macOS, Android, and Web.
|
A high-performance Flutter plugin for cross-platform image format conversion and resizing using native APIs on iOS, macOS, Android, and Web.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
@ -88,8 +90,10 @@ static Future<Uint8List> convert({
|
||||||
**Returns:** `Future<Uint8List>` containing the converted image data.
|
**Returns:** `Future<Uint8List>` containing the converted image data.
|
||||||
|
|
||||||
**Throws:**
|
**Throws:**
|
||||||
- `UnsupportedError`: If the platform or format is not supported.
|
- `UnsupportedError`: If the platform or output format is not supported.
|
||||||
- `Exception`: If conversion fails.
|
- `ImageDecodingException`: If the input image data cannot be decoded.
|
||||||
|
- `ImageEncodingException`: If the image cannot be encoded to the target format.
|
||||||
|
- `ImageConversionException`: For other general errors during the conversion process.
|
||||||
|
|
||||||
### `OutputFormat` Enum
|
### `OutputFormat` Enum
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class ImageConverter {
|
||||||
/// - [UnsupportedError]: If the platform or output format is not supported.
|
/// - [UnsupportedError]: If the platform or output format is not supported.
|
||||||
/// - [ImageDecodingException]: If the input image data cannot be decoded.
|
/// - [ImageDecodingException]: If the input image data cannot be decoded.
|
||||||
/// - [ImageEncodingException]: If the image cannot be encoded to the target format.
|
/// - [ImageEncodingException]: If the image cannot be encoded to the target format.
|
||||||
/// - [ImageConversionException]: For other general errors during the conversion process. ///
|
/// - [ImageConversionException]: For other general errors during the conversion process.
|
||||||
/// **Example - Convert HEIC to JPEG:**
|
/// **Example - Convert HEIC to JPEG:**
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// final jpegData = await ImageConverter.convert(
|
/// final jpegData = await ImageConverter.convert(
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:platform_image_converter/src/output_resize.dart';
|
||||||
/// **Implementations:**
|
/// **Implementations:**
|
||||||
/// - [ImageConverterDarwin]: iOS and macOS using ImageIO
|
/// - [ImageConverterDarwin]: iOS and macOS using ImageIO
|
||||||
/// - [ImageConverterAndroid]: Android using BitmapFactory
|
/// - [ImageConverterAndroid]: Android using BitmapFactory
|
||||||
|
/// - [ImageConverterWeb]: Web using Canvas API
|
||||||
abstract interface class ImageConverterPlatform {
|
abstract interface class ImageConverterPlatform {
|
||||||
/// Converts an image to a target format.
|
/// Converts an image to a target format.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue