rodrigograca31 / canvas2imageplugin Goto Github PK
View Code? Open in Web Editor NEWPhoneGap / Cordova plugin for iOS to save the contents of an HTML canvas to the device's Photo Library
PhoneGap / Cordova plugin for iOS to save the contents of an HTML canvas to the device's Photo Library
I check the permission to make sure it has been opened, please help to have a look
I am getting this warning for adding this plugin 'cordova-plugin-compat' as a dependency for 'canvas2Image'
However, due to the documentation related to the compat plugin,
it is deprecated and no longer being worked on as the functionality provided by this plugin is now included in cordova-android 6.3.0
https://www.npmjs.com/package/cordova-plugin-compat
kindly consider removing this dependency, as I guess it's no longer needed, and including it in the applications may cause a problem or unexpected behavior in the future.
Canvas2ImagePlugin.java compares the device's Android version (a string) with the string "2.3.3". On Android 10, this doesn't work as expected. I think the version check should either be updated to work with Android 10 or it should be removed entirely (I doubt there are many users still on Android 2 at this point).
can note saveImageDataToLibrary :: Log show me -> Permission not granted by the user.
How can I get the full path of the image (including it's name)? After the user save the image, I display that window for him to share, but I need the full file path.
I am having an issue with getting the correct path/filename back.
The plugin is returning:
file:///external/images/media/12035
however I find the file itself physically on the device here:
/storage/emulated/0/Pictures/c2i_1605857769374.png
the project is using
cordova android@9 with a target sdk of 29
the device is running Android 10
any help in resolving this would be greatly appreciated!
edit: it seems this might be (at least partially) related to Android 10 scoped storage?
my camera plugin stores images like this:
file:///storage/emulated/0/Android/data/com.appname.here/cache/1605859328822.jpg
and those work fine.
I noticed that every time I save a image, the memory usage will increase by about 3mb.
For my use case, it may be a big trouble.
Using instruments
, the problem seems to be in
cordova-plugin-canvas2image-updated/Canvas2ImagePlugin.m:26
I donβt know much about Objective-C and ios, I hope you can help me.
Here is my javascript code:
window.canvas2ImagePlugin.saveImageDataToLibrary(
function() {
navigator.notification.alert("saved", console.log);
canvas.remove();
},
function(err) {
navigator.notification.alert(err, console.log);
canvas.remove();
},
canvas,
"jpeg" // format is optional, defaults to 'png'
);
Thank you for your work.
it saves fine to the phone galery but i dont want to see the image on phone gallery can i create a folder inside the app ? im on android 10
Next Problem :
I want to use Base64 to save can u help me ?
It looks like this issue was never resolved:
devgeeks/Canvas2ImagePlugin#12
I'm working on an app that would benefit from this.
The problem seems to be getExternalStoragePublicDirectory
being deprecated
Error:
11-08 21:37:58.104 4284 4568 E Canvas2ImagePlugin: An exception occured while saving image: java.io.FileNotFoundException: /storage/emulated/0/Pictures/c2i_8102019213758103.jpg: open failed: EACCES (Permission denied)
Not working on Android 10 was previously mentioned in #4 ....
Getting error "The Operation is insecure."
I decided to update a few things and publish to npm.
I want to ping some users of this code to please move to npm and report any problems (should be 0)
@mixingyu @ataylor32 @lalab996 @lazydan @75yd @YDJSZY
Also, pro tip: use jpeg
for faster file creation.
P.S. github sponsors is enabled for this repo in can you guys have spare change π but a simple star or pull request also helps a lot!
Thanks everyone β€οΈ
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.