Email:[email protected]
Website:https://www.samoy.site
samoy / image_save Goto Github PK
View Code? Open in Web Editor NEWSave image to album or sandbox
Home Page: https://pub.dev/packages/image_save
License: MIT License
Save image to album or sandbox
Home Page: https://pub.dev/packages/image_save
License: MIT License
Email:[email protected]
Website:https://www.samoy.site
Currently image file will be saved at /stroage/emulated/0/{album_name}/IMAGE_$timestamp.$extension
. But according to new rules about the storage, the file might be saved at /storage/emulated/0/Android/data/xxx.xxxxxx.xx/files/{album_name}/IMAGE_$timestamp.$extension
.
Also, is there possible to expose image name
parameter for custom image name? e.g. I want the image filename as same as it was before.
Sorry, 没注意到是国人^_^
可否以新方式存储在对应的文件夹中?另外是否能暴露设置文件名的参数?
this is my problem,I am using your example on the pub
E/flutter ( 8461): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method saveImage on channel image_save)
E/flutter ( 8461): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7)
E/flutter ( 8461):
E/flutter ( 8461): #1 ImageSave.saveImage (package:image_save/image_save.dart:10:40)
E/flutter ( 8461): #2 _MyAppState._saveImage (package:flutterapp/main.dart:33:23)
E/flutter ( 8461):
E/flutter ( 8461): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
update needed.
If I save the image to sandbox (ImageSave.saveImageToSandbox(_data, "file.jpeg"), what is the path to this file ?
Many thanks.
This plugin works so well, but it lacks feature to rename the saved image file when using the method saveImage()
, though it's quite helpful with albumName
to name the folder in storage before saving the image file. Please add this feature, thanks. 🤞
Android
await ImageSave.saveImage("gif", Uint8List.fromList(_gif));
Error:
java.io.FileNotFoundException: /storage/emulated/0/测试APP/IMAGE_1571584085719.gif (No such file or directory)
the path not looks like not album path...
App name: "测试APP"
保存成功之后,没有图片路径 在分享的时候无法指定图片路径。
Flutter 1.17.2
How can I get the path of an image saved on iOS?
Is there any way to make the transparency part white instead of black when saving png as jpg?
Thank you!
我看了代码,这种情况下并未调用result返回错误,导致flutter层一直无法收到回调结果。麻烦修正一下
[VERBOSE-2:platform_view_layer.cc(22)] Trying to embed a platform view but the PrerollContext does not support embedding
[VERBOSE-2:platform_view_layer.cc(39)] Trying to embed a platform view but the PaintContext does not support embedding
D:\SDK\flutter.pub-cache\hosted\pub.dartlang.org\image_save-1.1.3\android\src\main\java\com\samoy\image_save\ImageSavePlugin.java:9: ����: �����android.support.annotation������
import android.support.annotation.NonNull;
^
D:\SDK\flutter.pub-cache\hosted\pub.dartlang.org\image_save-1.1.3\android\src\main\java\com\samoy\image_save\ImageSavePlugin.java:41: ����: �Ҳ�������
public void onMethodCall(MethodCall call,@nonnull Result result) {
^
����: �� NonNull
�: �� ImageSavePlugin
2 ������
FAILURE: Build failed with an exception.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 13s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
What permission do we need to save images on Android with this package for API 34?
Tried such options
according to documentation https://pub.dev/packages/permission_handler FAQ, but no luck.
Code sample
Future<bool> save(String filename, Uint8List data) async {
final ok = await ImageSave.saveImage(data, filename, albumName: 'someAlbum');
return ok ?? false;
}
在荣耀9(安卓9)上保存图片没问题
在realme x7 pro(安卓10)上保存图片失败
存储权限都确认给了
报错情况如下:
W/System.err( 5536): java.io.FileNotFoundException: /storage/emulated/0/Pictures/Lugoby/IMG_20210119_132512_767073.jpg: open failed: EACCES (Permission denied)
W/System.err( 5536): at libcore.io.IoBridge.open(IoBridge.java:538)
W/System.err( 5536): at java.io.FileOutputStream.(FileOutputStream.java:235)
W/System.err( 5536): at java.io.FileOutputStream.(FileOutputStream.java:186)
W/System.err( 5536): at com.samoy.image_save.ImageSavePlugin.saveImage(ImageSavePlugin.java:109)
W/System.err( 5536): at com.samoy.image_save.ImageSavePlugin.saveImageCall(ImageSavePlugin.java:88)
W/System.err( 5536): at com.samoy.image_save.ImageSavePlugin.methodCall(ImageSavePlugin.java:68)
W/System.err( 5536): at com.samoy.image_save.ImageSavePlugin.onMethodCall(ImageSavePlugin.java:58)
W/System.err( 5536): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err( 5536): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err( 5536): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/System.err( 5536): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err( 5536): at android.os.MessageQueue.next(MessageQueue.java:336)
W/System.err( 5536): at android.os.Looper.loop(Looper.java:184)
W/System.err( 5536): at android.app.ActivityThread.main(ActivityThread.java:7878)
W/System.err( 5536): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 5536): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
W/System.err( 5536): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
W/System.err( 5536): Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W/System.err( 5536): at libcore.io.Linux.open(Native Method)
W/System.err( 5536): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
W/System.err( 5536): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
W/System.err( 5536): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
W/System.err( 5536): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7768)
W/System.err( 5536): at libcore.io.IoBridge.open(IoBridge.java:524)
W/System.err( 5536): ... 16 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.