Use image_optim to optimize SVG assets with svgo

This commit is contained in:
Tom Hughes 2015-09-13 10:48:33 +01:00
parent 46d2e4ccfc
commit 284b56bee9
4 changed files with 27 additions and 0 deletions

View file

@ -40,6 +40,9 @@ gem "r2"
# Use autoprefixer to generate CSS prefixes
gem "autoprefixer-rails"
# Use image_optim to optimise images
gem "image_optim"
# Load rails plugins
gem "rails-i18n", "~> 4.0.0"
gem "dynamic_form"

View file

@ -84,8 +84,10 @@ GEM
dynamic_form (1.1.4)
erubis (2.7.0)
execjs (2.6.0)
exifr (1.2.3.1)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fspath (2.1.1)
globalid (0.3.6)
activesupport (>= 4.1.0)
hashie (3.4.2)
@ -98,6 +100,14 @@ GEM
i18n (0.7.0)
i18n-js (3.0.0.rc11)
i18n (~> 0.6)
image_optim (0.21.0)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 2.1)
image_size (~> 1.3)
in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1)
image_size (1.4.1)
in_threads (1.3.1)
jquery-rails (4.0.5)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
@ -189,6 +199,7 @@ GEM
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
progress (3.1.0)
psych (2.0.15)
r2 (0.2.5)
rack (1.6.4)
@ -315,6 +326,7 @@ DEPENDENCIES
http_accept_language (~> 2.0.0)
httpclient
i18n-js (>= 3.0.0.rc10)
image_optim
jquery-rails
jshint
json

View file

@ -56,5 +56,8 @@ module OpenStreetMap
config.logstasher.logger_path = LOGSTASH_PATH
config.logstasher.log_controller_parameters = true
end
# Configure image optimisation
config.assets.image_optim = YAML.load_file("#{Rails.root}/config/image_optim.yml")
end
end

9
config/image_optim.yml Normal file
View file

@ -0,0 +1,9 @@
skip_missing_workers: true
pngout: false
pngcrush: false
advpng: false
optipng: false
pngquant: false
jhead: false
jpegoptim: false
gifsicle: false