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
e54124d4
Commit
e54124d4
authored
Dec 17, 2019
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Preparation of erp5_base migration from FS: Fix pylint redefined-builtin warnings.
parent
080dafd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
product/ERP5/Document/Image.py
product/ERP5/Document/Image.py
+15
-15
No files found.
product/ERP5/Document/Image.py
View file @
e54124d4
...
@@ -189,9 +189,9 @@ class Image(TextConvertableMixin, File, OFSImage):
...
@@ -189,9 +189,9 @@ class Image(TextConvertableMixin, File, OFSImage):
id_list
=
list
(
DEFAULT_DISPLAY_ID_LIST
)
id_list
=
list
(
DEFAULT_DISPLAY_ID_LIST
)
# Exclude specified displays
# Exclude specified displays
if
exclude
:
if
exclude
:
for
id
in
exclude
:
for
id
_
in
exclude
:
if
id
in
id_list
:
if
id
_
in
id_list
:
id_list
.
remove
(
id
)
id_list
.
remove
(
id
_
)
# Sort by desired photo surface area
# Sort by desired photo surface area
def
getSurfaceArea
(
img
):
def
getSurfaceArea
(
img
):
x
,
y
=
self
.
getSizeFromImageDisplay
(
img
)
x
,
y
=
self
.
getSizeFromImageDisplay
(
img
)
...
@@ -214,22 +214,22 @@ class Image(TextConvertableMixin, File, OFSImage):
...
@@ -214,22 +214,22 @@ class Image(TextConvertableMixin, File, OFSImage):
displays
=
[]
displays
=
[]
if
quality
is
_MARKER
:
if
quality
is
_MARKER
:
quality
=
self
.
getDefaultImageQuality
(
format
)
quality
=
self
.
getDefaultImageQuality
(
format
)
for
id
in
self
.
displayIds
(
exclude
):
for
id
_
in
self
.
displayIds
(
exclude
):
if
self
.
_isGenerated
(
id
,
format
=
format
,
quality
=
quality
,
\
if
self
.
_isGenerated
(
id
_
,
format
=
format
,
quality
=
quality
,
\
resolution
=
resolution
):
resolution
=
resolution
):
photo_width
=
self
.
_photos
[(
id
,
format
)].
width
photo_width
=
self
.
_photos
[(
id
_
,
format
)].
width
photo_height
=
self
.
_photos
[(
id
,
format
)].
height
photo_height
=
self
.
_photos
[(
id
_
,
format
)].
height
bytes
=
self
.
_photos
[(
id
,
format
)].
_size
()
bytes
_
=
self
.
_photos
[(
id_
,
format
)].
_size
()
age
=
self
.
_photos
[(
id
,
format
)].
_age
()
age
=
self
.
_photos
[(
id
_
,
format
)].
_age
()
else
:
else
:
(
photo_width
,
photo_height
,
bytes
,
age
)
=
(
None
,
None
,
None
,
None
)
(
photo_width
,
photo_height
,
bytes
_
,
age
)
=
(
None
,
None
,
None
,
None
)
image_size
=
self
.
getSizeFromImageDisplay
(
id
)
image_size
=
self
.
getSizeFromImageDisplay
(
id
_
)
displays
.
append
({
'id'
:
id
,
displays
.
append
({
'id'
:
id
_
,
'width'
:
image_size
[
0
],
'width'
:
image_size
[
0
],
'height'
:
image_size
[
1
],
'height'
:
image_size
[
1
],
'photo_width'
:
photo_width
,
'photo_width'
:
photo_width
,
'photo_height'
:
photo_height
,
'photo_height'
:
photo_height
,
'bytes'
:
bytes
,
'bytes'
:
bytes
_
,
'age'
:
age
'age'
:
age
})
})
return
displays
return
displays
...
@@ -397,8 +397,8 @@ class Image(TextConvertableMixin, File, OFSImage):
...
@@ -397,8 +397,8 @@ class Image(TextConvertableMixin, File, OFSImage):
quality
=
self
.
getDefaultImageQuality
(
format
)
quality
=
self
.
getDefaultImageQuality
(
format
)
width
,
height
=
image_size
width
,
height
=
image_size
base
,
ext
=
splitext
(
self
.
id
)
base
,
ext
=
splitext
(
self
.
id
)
id
=
'%s_%s_%s.%s'
%
(
base
,
width
,
height
,
ext
,)
id
_
=
'%s_%s_%s.%s'
%
(
base
,
width
,
height
,
ext
,)
image
=
OFSImage
(
id
,
self
.
getTitle
(),
image
=
OFSImage
(
id
_
,
self
.
getTitle
(),
self
.
_getDisplayData
(
format
,
quality
,
resolution
,
self
.
_getDisplayData
(
format
,
quality
,
resolution
,
frame
,
image_size
,
frame
,
image_size
,
crop
))
crop
))
...
...
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