Commit e27b0820 authored by Ozzie Isaacs's avatar Ozzie Isaacs

Fix #1531 (white background on transparent cover instead of black one)

parent 25fc6f19
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment