Skip to content

Commit 1166d99

Browse files
committed
Follow image mode when padding
Forcing RBGA mode is not compatible with JPEG format. Instead follow the source image's mode. Fixes stephenmcd#1925
1 parent 3701d79 commit 1166d99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mezzanine/core/templatetags/mezzanine_tags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def thumbnail(
437437
pad_top = 0
438438
pad_left = (pad_width - from_width) // 2
439439
if pad_size is not None:
440-
pad_container = Image.new("RGBA", pad_size, padding_color)
440+
pad_container = Image.new(image.mode, pad_size, padding_color)
441441
pad_container.paste(image, (pad_left, pad_top))
442442
image = pad_container
443443

0 commit comments

Comments
 (0)