From a72572eb64570be706f63bb9230d6411d88048d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 18 Sep 2021 19:16:47 +0200 Subject: [PATCH] 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 --- Gemfile | 1 + Gemfile.lock | 6 ++++++ app/models/image.rb | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 20ed8d928..5302f6eb2 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,7 @@ gem "globalize-accessors", "~> 0.3.0" gem "graphiql-rails", "~> 1.7.0" gem "graphql", "~> 1.12.14" gem "groupdate", "~> 5.2.2" +gem "image_processing", "~> 1.12.2" gem "initialjs-rails", "~> 0.2.0.9" gem "invisible_captcha", "~> 2.0.0" gem "jquery-fileupload-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 14f5f5934..8e93b1c3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,6 +328,9 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) 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) railties (>= 3.1, < 7.0) invisible_captcha (2.0.0) @@ -570,6 +573,8 @@ GEM rubocop (~> 1.0) rubocop-ast (>= 1.1.0) ruby-progressbar (1.11.0) + ruby-vips (2.1.4) + ffi (~> 1.12) ruby2_keywords (0.0.5) rubyzip (2.3.2) rugged (1.0.1) @@ -744,6 +749,7 @@ DEPENDENCIES graphql (~> 1.12.14) groupdate (~> 5.2.2) i18n-tasks (~> 0.9.34) + image_processing (~> 1.12.2) initialjs-rails (~> 0.2.0.9) invisible_captcha (~> 2.0.0) jquery-fileupload-rails diff --git a/app/models/image.rb b/app/models/image.rb index 2f4cac7de..4d479d282 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -4,8 +4,8 @@ class Image < ApplicationRecord def self.styles { large: { resize: "x#{Setting["uploads.images.min_height"]}" }, - medium: { combine_options: { gravity: "center", resize: "300x300^", crop: "300x300+0+0" }}, - thumb: { combine_options: { gravity: "center", resize: "140x245^", crop: "140x245+0+0" }} + medium: { gravity: "center", resize: "300x300^", crop: "300x300+0+0" }, + thumb: { gravity: "center", resize: "140x245^", crop: "140x245+0+0" } } end