Canvas2ImagePlugin
Canvas2ImagePlugin copied to clipboard
How to get the file name?
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.
Ok, I read the source and done two modifications:
In savePhoto()
function, I created a string variable imageName
after imageUri
variable, then, on callbackContext.success call, I pass the path with file name.
private void savePhoto() {
Uri imageUri = null;
String imageName = "ep_" + System.currentTimeMillis() + (this.format.equals("png") ? ".png" : ".jpg");
//...
//...
callbackContext.success(imageUri.getPath() + "/" + imageName);
}
In my app, I receive something like this: /external/images/media/1539/ep_1597346437716.png
.
The Problem
Even though the share window recognize as image (see image below), no matter what app I choose, I doesn't accept it. With gmail, it says "cannot attach file". Whatsapp says "The file format is not supported". This is weird, since I can see and share the image normally if I go to my gallery.
I'm using this plugin to share, passing the file path in files
property.
its probably because of the location. you have to write in a folder that is accessible to all apps.