Skip to content

Commit

Permalink
Follow image mode when padding
Browse files Browse the repository at this point in the history
Forcing RBGA mode is not compatible with JPEG format. Instead follow the source image's mode. Fixes stephenmcd#1925
  • Loading branch information
dbischof committed Jul 17, 2021
1 parent 3701d79 commit 1166d99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mezzanine/core/templatetags/mezzanine_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def thumbnail(
pad_top = 0
pad_left = (pad_width - from_width) // 2
if pad_size is not None:
pad_container = Image.new("RGBA", pad_size, padding_color)
pad_container = Image.new(image.mode, pad_size, padding_color)
pad_container.paste(image, (pad_left, pad_top))
image = pad_container

Expand Down

0 comments on commit 1166d99

Please sign in to comment.