Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
8272704e
Commit
8272704e
authored
Mar 02, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Display intermediate image after get orientation
parent
5dcdc991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+12
-11
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
...teItem/web_page_module/rjs_gadget_document_scanner_js.xml
+2
-2
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
8272704e
...
...
@@ -402,6 +402,7 @@
image_capture
=
new
window
.
ImageCapture
(
gadget
.
element
.
querySelector
(
'
video
'
).
srcObject
.
getVideoTracks
()[
0
]
),
canvas
=
domsugar
(
'
canvas
'
,
{
'
class
'
:
'
canvas
'
}),
photo_blob
,
div
;
...
...
@@ -415,17 +416,9 @@
return
image_capture
.
takePhoto
({
imageWidth
:
capabilities
.
imageWidth
.
max
});
})
.
push
(
function
(
blob
)
{
photo_blob
=
blob
;
return
jIO
.
util
.
readBlobAsDataURL
(
blob
);
})
.
push
(
function
(
result
)
{
var
img
=
domsugar
(
"
img
"
,
{
"
src
"
:
result
.
target
.
result
});
gadget
.
detached_promise_dict
.
media_stream
.
cancel
(
'
Not needed anymore, as captured
'
);
div
=
gadget
.
element
.
querySelector
(
"
.camera-input
"
);
div
.
replaceChild
(
img
,
div
.
firstElementChild
);
return
RSVP
.
all
([
createImageBitmap
(
photo_
blob
),
getOrientation
(
photo_
blob
)
createImageBitmap
(
blob
),
getOrientation
(
blob
)
]);
})
.
push
(
function
(
result_list
)
{
...
...
@@ -433,7 +426,6 @@
orientation
=
result_list
[
1
],
height
=
bitmap
.
height
,
width
=
bitmap
.
width
,
canvas
=
domsugar
(
'
canvas
'
,
{
'
class
'
:
'
canvas
'
}),
ctx
;
if
(
4
<
orientation
&&
orientation
<
9
)
{
...
...
@@ -473,6 +465,15 @@
break
;
}
ctx
.
drawImage
(
bitmap
,
0
,
0
);
return
canvas
.
toDataURL
(
"
image/jpeg
"
);
})
.
push
(
function
(
result
)
{
var
img
=
domsugar
(
"
img
"
,
{
"
src
"
:
result
});
gadget
.
detached_promise_dict
.
media_stream
.
cancel
(
'
Not needed anymore, as captured
'
);
div
=
gadget
.
element
.
querySelector
(
"
.camera-input
"
);
div
.
replaceChild
(
img
,
div
.
firstElementChild
);
})
.
push
(
function
(
result_list
)
{
if
(
settings
.
brightness
||
settings
.
contrast
||
settings
.
enable_greyscale
||
settings
.
compression
)
{
return
handleCaman
(
canvas
,
settings
);
}
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
8272704e
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.
7505.28245.6314
</string>
</value>
<value>
<string>
982.
16570.34450.716
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
158
2772276.5
</float>
<float>
158
3144747.41
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment