Skip to content

Commit

Permalink
Set alpha channel flag to false when the image is flattened
Browse files Browse the repository at this point in the history
Fixes a bug with jpg images that become png (for e.g. &t=letterbox&bg=white).
  • Loading branch information
kleisauke committed Sep 5, 2018
1 parent e38fe50 commit bbae619
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/weserv/manipulators/background.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ function manipulator.process(image, args)
end

image = image:flatten({ background = background_color })

-- The image don't have an alpha channel now
args.has_alpha = false
end

return image
Expand Down

0 comments on commit bbae619

Please sign in to comment.