Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace_alpha and Background options together. #494

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion easy_thumbnails/processors.py
Expand Up @@ -315,7 +315,8 @@ def background(im, size, background=None, **kwargs):
# The image is already equal to (or larger than) the expected size, so
# there's nothing to do.
return im
im = colorspace(im, replace_alpha=background, **kwargs)
kwargs.setdefault('replace_alpha', background) #Avoid duplication in kwargs
im = colorspace(im, **kwargs)
new_im = Image.new('RGB', size, background)
if new_im.mode != im.mode:
new_im = new_im.convert(im.mode)
Expand Down