Skip to content

Commit

Permalink
Use mini_magick instead of rmagick adapter for image processing
Browse files Browse the repository at this point in the history
RMagick is such a pain to intall because of native extensions failing to
compile with imagemagick v7.x installed.

MiniMagick is much better alternative, ligther dependency and far
sufficient for fae requirements.
  • Loading branch information
lilfaf authored and jamesmk committed Apr 12, 2018
1 parent f94a156 commit b5620b3
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 439 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ gem 'rails', '~> 5.1.0'
gem 'rake', '< 12.0.0'

gem 'sass', require: 'sass'
gem 'rmagick', require: false

group :test, :development do
gem 'rspec-rails', '~> 3.6.0'
Expand Down
9 changes: 4 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ PATH
judge (~> 2.1.1)
judge-simple_form (~> 1.0.0)
kaminari (~> 1.1.1)
mini_magick
rails (>= 5.0)
remotipart (~> 1.4.0)
rmagick (~> 2.16.0)
sass (>= 3.4.0)
sass-rails (>= 5.0.7)
simple_form (~> 3.5.1)
Expand Down Expand Up @@ -199,11 +199,12 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.8.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
mysql2 (0.5.0)
mysql2 (0.5.1)
nenv (0.3.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
Expand Down Expand Up @@ -258,7 +259,6 @@ GEM
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rmagick (2.16.0)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
Expand Down Expand Up @@ -328,7 +328,7 @@ GEM
tilt (2.0.8)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.8)
uglifier (4.1.9)
execjs (>= 0.3.0, < 3)
warden (1.2.7)
rack (>= 1.0)
Expand Down Expand Up @@ -364,7 +364,6 @@ DEPENDENCIES
rails-controller-testing
rails-perftest
rake (< 12.0.0)
rmagick
rspec-rails (~> 3.6.0)
ruby-prof
sass
Expand Down
2 changes: 2 additions & 0 deletions app/uploaders/fae/file_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
module Fae
class FileUploader < CarrierWave::Uploader::Base

include CarrierWave::MiniMagick

process :save_file_size_in_model

def save_file_size_in_model
Expand Down
3 changes: 2 additions & 1 deletion app/uploaders/fae/image_uploader.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# encoding: utf-8
module Fae
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick

include CarrierWave::MiniMagick

# saves file size to DB
process :save_file_size_in_model
Expand Down
2 changes: 1 addition & 1 deletion fae.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Gem::Specification.new do |s|
s.add_dependency 'carrierwave', '~> 1.2.2'
s.add_dependency 'devise', '~> 4.4.3'
s.add_dependency 'jquery-ui-rails', '~> 6.0.1'
s.add_dependency 'mini_magick'
s.add_dependency 'judge', '~> 2.1.1'
s.add_dependency 'judge-simple_form', '~> 1.0.0'
s.add_dependency 'kaminari', '~> 1.1.1'
s.add_dependency 'remotipart', '~> 1.4.0'
s.add_dependency 'rmagick', '~> 2.16.0'
s.add_dependency 'simple_form', '~> 3.5.1'
s.add_dependency 'slim'

Expand Down
Loading

0 comments on commit b5620b3

Please sign in to comment.