correct file size and add note about impending breakage of image_optim

This commit is contained in:
Sam 2015-09-10 14:37:46 +10:00
parent 90ad943dd3
commit cd8d82aa31
3 changed files with 10 additions and 2 deletions

View file

@ -63,7 +63,8 @@ gem 'email_reply_parser'
# note: for image_optim to correctly work you need to follow # note: for image_optim to correctly work you need to follow
# https://github.com/toy/image_optim # 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 'multi_json'
gem 'mustache' gem 'mustache'
gem 'nokogiri' gem 'nokogiri'

View file

@ -422,7 +422,7 @@ DEPENDENCIES
highline highline
hiredis hiredis
htmlentities htmlentities
image_optim image_optim (= 0.20.2)
librarian (>= 0.0.25) librarian (>= 0.0.25)
listen (= 0.7.3) listen (= 0.7.3)
logster logster
@ -488,3 +488,6 @@ DEPENDENCIES
uglifier uglifier
unf unf
unicorn unicorn
BUNDLED WITH
1.10.6

View file

@ -100,6 +100,10 @@ class Upload < ActiveRecord::Base
# optimize image # optimize image
ImageOptim.new.optimize_image!(file.path) rescue nil 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 end
# compute the sha of the file # compute the sha of the file