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
b5712227
Commit
b5712227
authored
Mar 02, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Improve code and comment
parent
3add7a8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+11
-15
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 @
b5712227
...
...
@@ -17,7 +17,7 @@
});
}
function
handleDataURLRead
(
data_url
)
{
function
getOrientationFromDataUrl
(
data_url
)
{
var
view
=
new
DataView
(
data_url
),
length
=
view
.
byteLength
,
offset
=
2
,
...
...
@@ -59,18 +59,14 @@
return
-
1
;
}
function
getOrientation
(
blob
,
callback
)
{
var
fr
=
new
FileReader
();
return
new
RSVP
.
Promise
(
function
waitFormDataURLRead
(
resolve
,
reject
)
{
fr
.
addEventListener
(
"
load
"
,
function
onload
(
evt
)
{
resolve
(
handleDataURLRead
(
evt
.
target
.
result
));
function
getOrientation
(
blob
)
{
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
readBlobAsArrayBuffer
(
blob
);
})
.
push
(
function
(
evt
)
{
return
getOrientationFromDataUrl
(
evt
.
target
.
result
);
});
fr
.
addEventListener
(
"
error
"
,
reject
);
fr
.
readAsArrayBuffer
(
blob
);
},
function
cancelReadBlobAsDataURL
()
{
fr
.
abort
();
});
}
function
handleUserMedia
(
device_id
,
callback
)
{
...
...
@@ -159,11 +155,11 @@
viewMode
:
3
,
// Avoid any cropper calculation or guessing
scalable
:
false
,
//
By default rotatable is true, if you remove it.
//
Make sure, it is set on data
.
//
Please, DON'T touch on rotatable and checkOrientation. Removing it,
//
we will not be able to fix orientation before crop
.
rotatable
:
true
,
zoomable
:
false
,
checkOrientation
:
true
,
zoomable
:
false
,
movable
:
false
,
data
:
data
,
ready
:
function
()
{
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
b5712227
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.166
59.47570.45977
</string>
</value>
<value>
<string>
982.166
83.22364.19575
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
15831
49298.17
</float>
<float>
15831
53003.34
</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