Comments (9)
Then save it for yourself. You can use
data = await image.toByteData(format: ImageByteFormat.png)
to make a PNG out of it,
bytes = data!.buffer.asUint8List()
to get the byte data and you can easily save that to a File
:
file.writeAsBytes(bytes, flush)
from crop_image.
thanks you very much.
from crop_image.
I am getting this error when I try the above method:
E/FlutterJNI( 9460): Failed to decode image
E/FlutterJNI( 9460): android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error.
E/FlutterJNI( 9460): at android.graphics.ImageDecoder.nCreate(Native Method)
E/FlutterJNI( 9460): at android.graphics.ImageDecoder.access$200(ImageDecoder.java:169)
E/FlutterJNI( 9460): at android.graphics.ImageDecoder$ByteBufferSource.createImageDecoder(ImageDecoder.java:246)
E/FlutterJNI( 9460): at android.graphics.ImageDecoder.decodeBitmapImpl(ImageDecoder.java:1754)
E/FlutterJNI( 9460): at android.graphics.ImageDecoder.decodeBitmap(ImageDecoder.java:1747)
E/FlutterJNI( 9460): at io.flutter.embedding.engine.FlutterJNI.decodeImage(FlutterJNI.java:431)
════════ Exception caught by image resource service ════════════════════════════
The following _Exception was thrown resolving an image codec:
Exception: Invalid image data
When the exception was thrown, this was the stack
#0 _futurize (dart:ui/painting.dart:5394:5)
#1 ImageDescriptor.encoded (dart:ui/painting.dart:5262:12)
#2 instantiateImageCodec (dart:ui/painting.dart:2048:60)
<asynchronous suspension>
Path: /data/user/0/com.ilmdp.tennis_tennis_love/cache/image.png
from crop_image.
You have to check what's inside your image data. This is an exception from the painting routines of Flutter's engine, not this plugin.
from crop_image.
I was using Uint64list
. It was resolved when I switched to 8 bits. Thanks.
from crop_image.
@vannakyet Please let me know how you do this bitmap to file
from crop_image.
data = await image.toByteData(format: ImageByteFormat.png)
what is this image.toByteData. From where we can create this image can you please let me know @deakjahn @vannakyet
from crop_image.
A small error in the README. There are two Image types, ui.Image
and the plain Image
. The toByteData()
function belongs to the first one. It will be fixed in the coming version.
from crop_image.
@deakjahn Thanks
from crop_image.
Related Issues (20)
- Revert also down to meta 1.8.0? HOT 4
- How to programmatically set the crop area using controller? HOT 1
- How to programmatically set image rotation using controller? HOT 1
- Minimum width and height in pixels HOT 1
- Type 'ImageDecoderCallback' not found. HOT 6
- ImageDecoderCallback not found HOT 1
- CropGrid and Ract do not match after rotating the picture, HOT 2
- Request a function that allows grid color separation HOT 2
- Type 'ImageDecoderCallback' not found HOT 2
- Maximum width/height, fixed crop size HOT 1
- When i crop a gif it will make it a png image HOT 1
- The cropper don't work on mobile and tablet web HOT 2
- ArgumentError Invalid argument(s): 302.575306122449 HOT 6
- How to get path of cropped image? HOT 1
- UI issue - Bottom menu is hidden on IOS Chrome browser. HOT 5
- [WEB] Large image sizes are missing top and right areas, with croppedBitmap HOT 4
- Custom corners - option to hide corners HOT 2
- The cropper is not repainting when we change any of the grid properties such as Color/InnerColor/Corner size ect HOT 1
- Crop the image natively HOT 1
- Additional "eraser" feature HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crop_image.