diff --git a/web/src/components/inputs/InputPhoto.vue b/web/src/components/inputs/InputPhoto.vue index 5b022d5..e50033b 100644 --- a/web/src/components/inputs/InputPhoto.vue +++ b/web/src/components/inputs/InputPhoto.vue @@ -3,7 +3,7 @@ { + const mime_type = response.headers.get("content-type"); + response.arrayBuffer().then((buf) => { + const base64 = btoa(new Uint8Array(buf) + .reduce((data, byte) => data + String.fromCharCode(byte), "")); + this.dataImage = "data:" + mime_type + ";base64," + base64; + }); + }) } }, mounted() { if (!this.model[this.field]) this.openStream(); + else + this.loadImage(); }, beforeDestroy() { this.closeStream();