Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
e27b0820
Commit
e27b0820
authored
Jul 23, 2020
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1531 (white background on transparent cover instead of black one)
parent
25fc6f19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
uploader.py
cps/uploader.py
+4
-1
No files found.
cps/uploader.py
View file @
e27b0820
...
...
@@ -35,7 +35,7 @@ except ImportError:
lxmlversion
=
None
try
:
from
wand.image
import
Image
from
wand.image
import
Image
,
Color
from
wand
import
version
as
ImageVersion
from
wand.exceptions
import
PolicyError
use_generic_pdf_cover
=
False
...
...
@@ -149,6 +149,9 @@ def pdf_preview(tmp_file_path, tmp_dir):
img
.
options
[
"pdf:use-cropbox"
]
=
"true"
img
.
read
(
filename
=
tmp_file_path
+
'[0]'
,
resolution
=
150
)
img
.
compression_quality
=
88
if
img
.
alpha_channel
:
img
.
alpha_channel
=
'remove'
img
.
background_color
=
Color
(
'white'
)
img
.
save
(
filename
=
os
.
path
.
join
(
tmp_dir
,
cover_file_name
))
return
cover_file_name
except
PolicyError
as
ex
:
...
...
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