Commit 51353ae0 authored by Romain Courteaud's avatar Romain Courteaud

erp5_document_scanner: display the last video frame

parent c7464a14
...@@ -551,11 +551,13 @@ ...@@ -551,11 +551,13 @@
image_capture = new window.ImageCapture( image_capture = new window.ImageCapture(
gadget.element.querySelector('video').srcObject.getVideoTracks()[0] gadget.element.querySelector('video').srcObject.getVideoTracks()[0]
), ),
original_blob_url,
blob_url, blob_url,
original_width, original_width,
original_height; original_height;
// Display last video frame while doing calculation
gadget.element.querySelector('video').pause();
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
btn.classList.remove("ui-icon-circle"); btn.classList.remove("ui-icon-circle");
...@@ -573,13 +575,6 @@ ...@@ -573,13 +575,6 @@
}) })
.push(function (blob) { .push(function (blob) {
gadget.detached_promise_dict.media_stream.cancel('Not needed anymore, as captured'); gadget.detached_promise_dict.media_stream.cancel('Not needed anymore, as captured');
// Display photo while doing calculation
original_blob_url = URL.createObjectURL(blob);
var img = domsugar("img", {"src": original_blob_url}),
div = gadget.element.querySelector(".camera-input");
div.replaceChild(img, div.firstElementChild);
return resizePhoto(blob, original_width, original_height); return resizePhoto(blob, original_width, original_height);
}) })
.push(function (blob) { .push(function (blob) {
...@@ -641,7 +636,6 @@ ...@@ -641,7 +636,6 @@
}) })
.push(function (cropper) { .push(function (cropper) {
URL.revokeObjectURL(blob_url); URL.revokeObjectURL(blob_url);
URL.revokeObjectURL(original_blob_url);
gadget.cropper = cropper; gadget.cropper = cropper;
}); });
} }
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>982.58333.43653.1348</string> </value> <value> <string>982.58354.63381.1604</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1585649164.66</float> <float>1585650508.06</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment