mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
correct file size and add note about impending breakage of image_optim
This commit is contained in:
parent
90ad943dd3
commit
cd8d82aa31
3 changed files with 10 additions and 2 deletions
3
Gemfile
3
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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue