AS
Size: a a a
AS
KV
MM
AS
MM
AS
KV
Ć
Ć
AS
let readAsDataURLPromise = this.file.readAsDataURL(fDir, fName)
.then(data => {
})
.catch(error=> {
});
AS
AS
AS
const path = 'file:///storage/emulated/0/DCIM/Camera/';
const file = '20191120_184923.jpg';
console.log(path+file);
this.plt.ready().then(() => {
console.log('platform is ready');
console.log(`converting ${path}${file} to dataUrl...`);
this.filePlugin.readAsDataURL(path, file).then(dataUrl=>{
console.log('converted' + dataUrl);
}, (error)=>{
console.log('error: '+JSON.stringify(error));
})
});
I/chromium: [INFO:CONSOLE(1873)] "file:///storage/emulated/0/DCIM/Camera/20191120_184923.jpg", source: http://localhost/build/main.js (1873)
D/SystemWebChromeClient: http://localhost/build/main.js: Line 1875 : platform is ready
I/chromium: [INFO:CONSOLE(1875)] "platform is ready", source: http://localhost/build/main.js (1875)
D/SystemWebChromeClient: http://localhost/build/main.js: Line 1876 : converting file:///storage/emulated/0/DCIM/Camera/20191120_184923.jpg to dataUrl...
I/chromium: [INFO:CONSOLE(1876)] "converting file:///storage/emulated/0/DCIM/Camera/20191120_184923.jpg to dataUrl...", source: http://localhost/build/main.js (1876)
D/InputMethodManager: HSIFW - flag : 0 Pid : 27170
else if (action.equals("readAsDataURL")) {
threadhelper( new FileOp( ){
public void run(JSONArray args) throws JSONException, MalformedURLException {
int start = args.getInt(1);
int end = args.getInt(2);
String fname=args.getString(0);
readFileAs(fname, start, end, callbackContext, null, -1);
}
}, rawArgs, callbackContext);
}
byte[] base64 = Base64.encode(os.toByteArray(), Base64.NO_WRAP);
String s = "data:" + contentType + ";base64," + new String(base64, "US-ASCII");
result = new PluginResult(PluginResult.Status.OK, s);
}
callbackContext.sendPluginResult(result);
O
С.
AS
Ć
Ć