diff --git a/cps/uploader.py b/cps/uploader.py index 74c94d83..e693d8e8 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -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: