Skip to content

Commit

Permalink
Convert p image to remove transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
phibos committed Feb 7, 2025
1 parent 6cbbaa8 commit db9b78b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pelican/plugins/photos/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,8 @@ def _operation_remove_alpha(self, image: PILImage.Image) -> PILImage.Image:
"""Remove the alpha channel."""
if not self.is_alpha(image):
return image
if image.mode == "P":
image = image.convert("RGBA")
background = PILImage.new(
"RGB", image.size, self._pelican_settings["PHOTO_ALPHA_BACKGROUND_COLOR"]
)
Expand Down

0 comments on commit db9b78b

Please sign in to comment.