Skip to content

Commit

Permalink
fixes black background on transparent image jpeg previews
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Accorsi committed Feb 20, 2018
1 parent c86cce8 commit 7fa6fd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions preview_generator/preview/builder/image__wand.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def convert_pdf_to_jpeg(
preview_size: ImgDims
) -> BytesIO:
with WImage(file=pdf) as img:
img.background_color = Color('white')
# HACK - D.A. - 2017-08-01
# The following line avoid black background in case of transparent
# The following 2 lines avoid black background in case of transparent
# objects found on the page. As we save to JPEG, this is not a problem
img.alpha_channel = False
img.background_color = Color('white')
img.alpha_channel = 'remove'

resize_dims = compute_resize_dims(
ImgDims(img.width, img.height),
Expand Down

0 comments on commit 7fa6fd5

Please sign in to comment.