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
|
# 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'
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue