commit
d1fec905fc
|
|
@ -1,5 +1,7 @@
|
|||
# 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.
|
||||
|
||||
## Features
|
||||
|
|
@ -88,8 +90,10 @@ static Future<Uint8List> convert({
|
|||
**Returns:** `Future<Uint8List>` containing the converted image data.
|
||||
|
||||
**Throws:**
|
||||
- `UnsupportedError`: If the platform or format is not supported.
|
||||
- `Exception`: If conversion fails.
|
||||
- `UnsupportedError`: If the platform or output format is not supported.
|
||||
- `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
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class ImageConverter {
|
|||
/// - [UnsupportedError]: If the platform or output format is not supported.
|
||||
/// - [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. ///
|
||||
/// - [ImageConversionException]: For other general errors during the conversion process.
|
||||
/// **Example - Convert HEIC to JPEG:**
|
||||
/// ```dart
|
||||
/// final jpegData = await ImageConverter.convert(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import 'package:platform_image_converter/src/output_resize.dart';
|
|||
/// **Implementations:**
|
||||
/// - [ImageConverterDarwin]: iOS and macOS using ImageIO
|
||||
/// - [ImageConverterAndroid]: Android using BitmapFactory
|
||||
/// - [ImageConverterWeb]: Web using Canvas API
|
||||
abstract interface class ImageConverterPlatform {
|
||||
/// Converts an image to a target format.
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in New Issue