Skip to content

Commit

Permalink
Use latest version of rmagick for Ruby 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogregorius committed Sep 8, 2023
1 parent aa17243 commit af4078d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion carrierwave.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ Gem::Specification.new do |s|
s.add_development_dependency "fog-rackspace"
s.add_development_dependency "mini_magick", ">= 3.6.0"
if RUBY_ENGINE != 'jruby'
s.add_development_dependency "rmagick", "~> 2.16"
if RUBY_VERSION < '3.2'
s.add_development_dependency "rmagick", "~> 2.16"
else
s.add_development_dependency "rmagick"
end
end
s.add_development_dependency "timecop"
s.add_development_dependency "generator_spec", ">= 0.9.1"
Expand Down
2 changes: 1 addition & 1 deletion lib/carrierwave/processing/rmagick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def resize_and_pad(width, height, background=:transparent, gravity=::Magick::Cen
height = dimension_from height
manipulate! do |img|
img.resize_to_fit!(width, height)
new_img = ::Magick::Image.new(width, height) { self.background_color = background == :transparent ? 'rgba(255,255,255,0)' : background.to_s }
new_img = ::Magick::Image.new(width, height) { |options| options.background_color = background == :transparent ? 'rgba(255,255,255,0)' : background.to_s }
if background == :transparent
filled = new_img.matte_floodfill(1, 1)
else
Expand Down

0 comments on commit af4078d

Please sign in to comment.