Add option to strip EXIF profiles

This commit is contained in:
Bert Driehuis 2018-01-19 01:08:35 +01:00
parent c9da267bee
commit 826b5f715e
3 changed files with 10 additions and 1 deletions

View File

@ -52,6 +52,11 @@ responsive_image:
# working with JPGs directly from digital cameras and smartphones
auto_rotate: false
# [Optional, Default: false]
# Strip EXIF and other JPEG profiles. Helps to minimize JPEG size and win friends
# at Google PageSpeed.
strip: false
# [Optional, Default: assets]
# The base directory where assets are stored. This is used to determine the
# `dirname` value in `output_path_format` below.

View File

@ -9,7 +9,8 @@ module Jekyll
'extra_images' => [],
'auto_rotate' => false,
'save_to_source' => true,
'cache' => false
'cache' => false,
'strip' => false
}
def initialize(site)

View File

@ -36,6 +36,9 @@ module Jekyll
Jekyll.logger.info "Generating #{target_filepath}"
if config['strip']
img.strip!
end
i = img.scale(ratio)
i.write(target_filepath) do |f|
f.interlace = i.interlace