diff --git a/Gemfile b/Gemfile index e8b2403e5ac..2332689189a 100644 --- a/Gemfile +++ b/Gemfile @@ -63,7 +63,8 @@ gem 'email_reply_parser' # note: for image_optim to correctly work you need to follow # https://github.com/toy/image_optim -gem 'image_optim' +# pinned due to https://github.com/toy/image_optim/pull/75, docker image must be upgraded to upgrade +gem 'image_optim', '0.20.2' gem 'multi_json' gem 'mustache' gem 'nokogiri' diff --git a/Gemfile.lock b/Gemfile.lock index 338070cfa7b..44397f9df5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -422,7 +422,7 @@ DEPENDENCIES highline hiredis htmlentities - image_optim + image_optim (= 0.20.2) librarian (>= 0.0.25) listen (= 0.7.3) logster @@ -488,3 +488,6 @@ DEPENDENCIES uglifier unf unicorn + +BUNDLED WITH + 1.10.6 diff --git a/app/models/upload.rb b/app/models/upload.rb index 59a647f769e..39e5fb94efc 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -100,6 +100,10 @@ class Upload < ActiveRecord::Base # optimize image ImageOptim.new.optimize_image!(file.path) rescue nil + + # correct size so it displays the optimized image size which is the only + # one that is stored + filesize = File.size(file.path) end # compute the sha of the file