Add image_processing gem dependency
It's now used by default to handle image variants. We were getting a warning: DEPRECATION WARNING: Generating image variants will require the image_processing gem in Rails 6.1. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile. Note `mini_magick` is required in order to use the `analyze` method [1]. Since we use it in our image (and site customization image) validations, we're still keeping the explicit dependency in our Gemfile. [1] https://guides.rubyonrails.org/v6.0/active_storage_overview.html#analyzing-files
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -28,6 +28,7 @@ gem "globalize-accessors", "~> 0.3.0"
|
|||||||
gem "graphiql-rails", "~> 1.7.0"
|
gem "graphiql-rails", "~> 1.7.0"
|
||||||
gem "graphql", "~> 1.12.14"
|
gem "graphql", "~> 1.12.14"
|
||||||
gem "groupdate", "~> 5.2.2"
|
gem "groupdate", "~> 5.2.2"
|
||||||
|
gem "image_processing", "~> 1.12.2"
|
||||||
gem "initialjs-rails", "~> 0.2.0.9"
|
gem "initialjs-rails", "~> 0.2.0.9"
|
||||||
gem "invisible_captcha", "~> 2.0.0"
|
gem "invisible_captcha", "~> 2.0.0"
|
||||||
gem "jquery-fileupload-rails"
|
gem "jquery-fileupload-rails"
|
||||||
|
|||||||
@@ -328,6 +328,9 @@ GEM
|
|||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
terminal-table (>= 1.5.1)
|
terminal-table (>= 1.5.1)
|
||||||
ice_nine (0.11.2)
|
ice_nine (0.11.2)
|
||||||
|
image_processing (1.12.2)
|
||||||
|
mini_magick (>= 4.9.5, < 5)
|
||||||
|
ruby-vips (>= 2.0.17, < 3)
|
||||||
initialjs-rails (0.2.0.9)
|
initialjs-rails (0.2.0.9)
|
||||||
railties (>= 3.1, < 7.0)
|
railties (>= 3.1, < 7.0)
|
||||||
invisible_captcha (2.0.0)
|
invisible_captcha (2.0.0)
|
||||||
@@ -570,6 +573,8 @@ GEM
|
|||||||
rubocop (~> 1.0)
|
rubocop (~> 1.0)
|
||||||
rubocop-ast (>= 1.1.0)
|
rubocop-ast (>= 1.1.0)
|
||||||
ruby-progressbar (1.11.0)
|
ruby-progressbar (1.11.0)
|
||||||
|
ruby-vips (2.1.4)
|
||||||
|
ffi (~> 1.12)
|
||||||
ruby2_keywords (0.0.5)
|
ruby2_keywords (0.0.5)
|
||||||
rubyzip (2.3.2)
|
rubyzip (2.3.2)
|
||||||
rugged (1.0.1)
|
rugged (1.0.1)
|
||||||
@@ -744,6 +749,7 @@ DEPENDENCIES
|
|||||||
graphql (~> 1.12.14)
|
graphql (~> 1.12.14)
|
||||||
groupdate (~> 5.2.2)
|
groupdate (~> 5.2.2)
|
||||||
i18n-tasks (~> 0.9.34)
|
i18n-tasks (~> 0.9.34)
|
||||||
|
image_processing (~> 1.12.2)
|
||||||
initialjs-rails (~> 0.2.0.9)
|
initialjs-rails (~> 0.2.0.9)
|
||||||
invisible_captcha (~> 2.0.0)
|
invisible_captcha (~> 2.0.0)
|
||||||
jquery-fileupload-rails
|
jquery-fileupload-rails
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ class Image < ApplicationRecord
|
|||||||
def self.styles
|
def self.styles
|
||||||
{
|
{
|
||||||
large: { resize: "x#{Setting["uploads.images.min_height"]}" },
|
large: { resize: "x#{Setting["uploads.images.min_height"]}" },
|
||||||
medium: { combine_options: { gravity: "center", resize: "300x300^", crop: "300x300+0+0" }},
|
medium: { gravity: "center", resize: "300x300^", crop: "300x300+0+0" },
|
||||||
thumb: { combine_options: { gravity: "center", resize: "140x245^", crop: "140x245+0+0" }}
|
thumb: { gravity: "center", resize: "140x245^", crop: "140x245+0+0" }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user