#211 load cell/save cell to file

This commit is contained in:
Jan Prochazka
2022-02-03 15:16:54 +01:00
parent 7297976843
commit d32ec5ecb1
3 changed files with 84 additions and 5 deletions

View File

@@ -5,11 +5,16 @@
export let selection;
function extractPicture(values) {
const value = values;
if (value?.type == 'Buffer' && _.isArray(value?.data)) {
return 'data:image/png;base64, ' + btoa(String.fromCharCode.apply(null, value?.data));
try {
const value = values;
if (value?.type == 'Buffer' && _.isArray(value?.data)) {
return 'data:image/png;base64, ' + btoa(String.fromCharCode.apply(null, value?.data));
}
return null;
} catch (err) {
console.log('Error showing picture', err);
return null;
}
return null;
}
$: picture = extractPicture(selection[0]?.value);