image_editor 0.4.0 image_editor: ^0.4.0 copied to clipboard
Rotate ,flip, crop your image. Use objc/kotlin to handle it.
image_editor #
Support android ios, use the native way to flip, crop, rotate pictures.
The version of readme pub and github may be inconsistent, please refer to github.
Screenshot #
Usage #
dependencies:
image_editor: ^0.2.0
Import
import 'package:image_editor/image_editor.dart';
Method list:
ImageEditor.editImage();
ImageEditor.editFileImage();
ImageEditor.editFileImageAndGetFile();
ImageEditor.editImageAndGetFile();
ImageEditor method params #
Name | Description |
---|---|
image | dart.typed_data.Uint8List |
file | dart.io.File |
imageEditorOption | flutter_image_editor.ImageEditorOption |
ImageEditorOption #
final editorOption = ImageEditorOption();
editorOption.addOption(FlipOption());
editorOption.addOption(ClipOption());
editorOption.addOption(RotateOption());
editorOption.outputFormat = OutputFormat.png(88);
Option #
Flip
FlipOption(horizontal:true, vertical:false);
Clip
ClipOption(x:0, y:0, width:1920, height:1920);
Rotate
RotateOption(degree: 180);
Color
ColorOption();
In android, it's use 5x4 matrix : https://developer.android.google.cn/reference/android/graphics/ColorMatrix.html
a, b, c, d, e,
f, g, h, i, j,
k, l, m, n, o,
p, q, r, s, t
In iOS, it's use 4x4 matrix. The last of line will be ignored.
a, b, c, d,
f, g, h, i,
k, l, m, n,
p, q, r, s
ScaleOption
ScaleOption(width,height);
After specifying the width and height, it is not clipped, but stretched to the specified width and height (Does not maintain the aspect ratio of the image).
OutputFormat #
var outputFormat = OutputFormat.png();
var outputFormat = OutputFormat.jpeg(95);
Common issue #
..../image_editor-0.1.4/ios/Classes/FlutterImageEditorPlugin.m:2:9: 'image_editor/image_editor-Swift.h' file not found
See #10
LICENSE #
MIT Style.
Third party #
Under BSD3 style: GPUImage
Under Apache 2.0 style: Some martix code come from android sdk.