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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
erp5
Commits
9e8adf0f
Commit
9e8adf0f
authored
Mar 31, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: allow to configure the maximum width
parent
ad0e9c74
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
5 deletions
+162
-5
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.js
...tem/web_page_module/scanner_gadget_document_scanner_js.js
+3
-3
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.xml
...em/web_page_module/scanner_gadget_document_scanner_js.xml
+2
-2
bt5/erp5_document_scanner/PropertySheetTemplateItem/portal_property_sheets/DocumentScannerPreference/preferred_image_scanner_conversion_maximum_width_property.xml
...erred_image_scanner_conversion_maximum_width_property.xml
+59
-0
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredImageSettingsFromPreference.py
...t_scanner/Base_getPreferredImageSettingsFromPreference.py
+1
-0
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Preference_viewDocumentScannerSetting.xml
...ocument_scanner/Preference_viewDocumentScannerSetting.xml
+1
-0
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Preference_viewDocumentScannerSetting/my_preferred_image_scanner_conversion_maximum_width.xml
...g/my_preferred_image_scanner_conversion_maximum_width.xml
+96
-0
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.js
View file @
9e8adf0f
...
...
@@ -426,7 +426,7 @@
.
push
(
function
(
result
)
{
orientation
=
result
;
var
expected_width
=
2000
,
var
expected_width
=
settings
.
maximum_width
,
bitmap_options
,
div
;
...
...
@@ -434,12 +434,12 @@
// and size is small
// no color correction is expected
if
(((
orientation
<
2
)
||
(
8
<
orientation
))
&&
(
original_width
<
expected_width
)
&&
(
(
!
expected_width
)
||
(
original_width
<
expected_width
)
)
&&
(
!
(
settings
.
brightness
||
settings
.
contrast
||
settings
.
enable_greyscale
)))
{
return
blob
;
}
if
(
expected_width
<
original_width
)
{
if
(
(
!!
expected_width
)
&&
(
expected_width
<
original_width
)
)
{
bitmap_options
=
{
resizeWidth
:
expected_width
,
// resizeHeight: expected_height,
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.xml
View file @
9e8adf0f
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.585
09.58580.23415
</string>
</value>
<value>
<string>
982.585
26.37480.14609
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
15856
59717.1
3
</float>
<float>
15856
60747.2
3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_document_scanner/PropertySheetTemplateItem/portal_property_sheets/DocumentScannerPreference/preferred_image_scanner_conversion_maximum_width_property.xml
0 → 100644
View file @
9e8adf0f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mode
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/int
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_image_scanner_conversion_maximum_width_property
</string>
</value>
</item>
<item>
<key>
<string>
mode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredImageSettingsFromPreference.py
View file @
9e8adf0f
...
...
@@ -7,6 +7,7 @@ setting_dict = {
"enable_greyscale"
:
preference_tool
.
getPreferredImageScannerConversionEnableGreyscale
(),
"brightness"
:
preference_tool
.
getPreferredImageScannerConversionBrightness
(),
"contrast"
:
preference_tool
.
getPreferredImageScannerConversionContrast
(),
"maximum_width"
:
preference_tool
.
getPreferredImageScannerConversionMaximumWidth
()
}
return
json
.
dumps
(
setting_dict
)
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Preference_viewDocumentScannerSetting.xml
View file @
9e8adf0f
...
...
@@ -91,6 +91,7 @@
<key>
<string>
right
</string>
</key>
<value>
<list>
<string>
my_preferred_image_scanner_conversion_maximum_width
</string>
<string>
my_preferred_image_scanner_conversion_compression
</string>
<string>
my_preferred_image_scanner_conversion_brightness
</string>
<string>
my_preferred_image_scanner_conversion_contrast
</string>
...
...
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Preference_viewDocumentScannerSetting/my_preferred_image_scanner_conversion_maximum_width.xml
0 → 100644
View file @
9e8adf0f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_preferred_image_scanner_conversion_maximum_width
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_integer_value
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Maximum Width
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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