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