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
cbe8dc7e
Commit
cbe8dc7e
authored
Feb 18, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Avoid caman to consume all memory
parent
82b80334
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml
...Item/web_page_module/rjs_gadget_document_scanner_html.xml
+2
-2
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+14
-2
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeNewImageCropped.py
..._skins/erp5_document_scanner/Base_storeNewImageCropped.py
+0
-1
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml
View file @
cbe8dc7e
...
@@ -242,7 +242,7 @@
...
@@ -242,7 +242,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.5
0676.50330.49885
</string>
</value>
<value>
<string>
981.5
9367.17937.61354
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1581
434761.85
</float>
<float>
1581
984312.27
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
cbe8dc7e
...
@@ -299,7 +299,8 @@
...
@@ -299,7 +299,8 @@
image_capture
=
new
window
.
ImageCapture
(
image_capture
=
new
window
.
ImageCapture
(
gadget
.
element
.
querySelector
(
'
video
'
).
srcObject
.
getVideoTracks
()[
0
]
gadget
.
element
.
querySelector
(
'
video
'
).
srcObject
.
getVideoTracks
()[
0
]
),
),
div
;
div
,
local_caman
;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -323,7 +324,7 @@
...
@@ -323,7 +324,7 @@
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
return
new
Promise
(
function
(
resolve
)
{
return
new
Promise
(
function
(
resolve
)
{
// XXX the correct usage is `new Caman()` but the library does not support it
// XXX the correct usage is `new Caman()` but the library does not support it
caman
(
canvas
,
null
,
function
()
{
local_caman
=
caman
(
canvas
,
null
,
function
()
{
if
(
settings
.
brightness
&&
settings
.
brightness
!==
0
)
{
if
(
settings
.
brightness
&&
settings
.
brightness
!==
0
)
{
this
.
brightness
(
settings
.
brightness
);
this
.
brightness
(
settings
.
brightness
);
}
}
...
@@ -334,6 +335,14 @@
...
@@ -334,6 +335,14 @@
this
.
greyscale
();
this
.
greyscale
();
}
}
this
.
render
(
function
()
{
this
.
render
(
function
()
{
// It's weird but Caman store a lot of data
// in this variables. Please, double check before remove
// this code
this
.
pixelData
=
null
;
this
.
originalPixelData
=
null
;
this
.
renderer
.
modPixelData
=
null
;
this
.
imageData
=
null
;
this
.
initializedPixelData
=
null
;
resolve
([
this
.
context
.
canvas
,
settings
.
compression
]);
resolve
([
this
.
context
.
canvas
,
settings
.
compression
]);
});
});
});
});
...
@@ -346,6 +355,9 @@
...
@@ -346,6 +355,9 @@
var
canvas
=
result_list
[
0
],
var
canvas
=
result_list
[
0
],
compression
=
settings
.
compression
||
1
;
compression
=
settings
.
compression
||
1
;
// Clear caman as much as possible
local_caman
=
null
;
caman
.
Store
.
flush
(
true
);
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
getTranslationList
([
"
Delete
"
,
"
Save
"
]),
gadget
.
getTranslationList
([
"
Delete
"
,
"
Save
"
]),
new
Promise
(
function
(
resolve
)
{
new
Promise
(
function
(
resolve
)
{
...
...
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeNewImageCropped.py
View file @
cbe8dc7e
import
json
import
json
_
,
uuid
=
context
.
Base_postDataToActiveResult
(
_
,
uuid
=
context
.
Base_postDataToActiveResult
(
active_process_url
,
input_value
,
active_process_url
,
input_value
,
generate_new_uid
=
True
)
generate_new_uid
=
True
)
...
...
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