Skip to content

Commit

Permalink
Remove alpha channel from transparent images (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
bb authored Oct 22, 2024
1 parent 633e22d commit 1580cc7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/shrine/plugins/blurhash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def extract_with_ruby_vips(io, resize_to)
Shrine.with_file(io) do |file|
image = Vips::Image.new_from_file(file.path, access: :sequential)
image = image.resize(resize_to.fdiv(image.width), vscale: resize_to.fdiv(image.height)) if resize_to
image = image.flatten if image.has_alpha?

{
width: image.width,
Expand Down

0 comments on commit 1580cc7

Please sign in to comment.