Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pole-Web
Website
Commits
b129e1f0
Commit
b129e1f0
authored
May 11, 2022
by
Fefe
Browse files
Paramétrage compression
parent
0a5efba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
photo/views.py
View file @
b129e1f0
...
...
@@ -97,7 +97,7 @@ def create_compressed_image(realpath, filename):
side
=
int
(
COMPRESSED_SIZE
[
1
]
*
original_size
[
0
]
/
original_size
[
1
])
image
=
image
.
resize
((
side
,
COMPRESSED_SIZE
[
1
]),
Image
.
ANTIALIAS
)
image
.
save
(
os
.
path
.
join
(
realpath
,
COMPRESSED_DIRNAME
,
filename
),
"JPEG"
,
optimize
=
True
,
quality
=
75
)
image
.
save
(
os
.
path
.
join
(
realpath
,
COMPRESSED_DIRNAME
,
filename
),
"JPEG"
,
optimize
=
True
,
quality
=
COMPRESSION_QUALITY
)
except
OSError
:
return
...
...
Write
Preview
Supports
Markdown
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