Skip to content

Commit 61824c5

Browse files
authored
Convert p image to remove transparency (#130)
1 parent 6cbbaa8 commit 61824c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pelican/plugins/photos/photos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,8 @@ def _operation_remove_alpha(self, image: PILImage.Image) -> PILImage.Image:
12821282
"""Remove the alpha channel."""
12831283
if not self.is_alpha(image):
12841284
return image
1285+
if image.mode == "P":
1286+
image = image.convert("RGBA")
12851287
background = PILImage.new(
12861288
"RGB", image.size, self._pelican_settings["PHOTO_ALPHA_BACKGROUND_COLOR"]
12871289
)

0 commit comments

Comments
 (0)