Add option to strip EXIF profiles
This commit is contained in:
parent
c9da267bee
commit
826b5f715e
|
@ -52,6 +52,11 @@ responsive_image:
|
||||||
# working with JPGs directly from digital cameras and smartphones
|
# working with JPGs directly from digital cameras and smartphones
|
||||||
auto_rotate: false
|
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]
|
# [Optional, Default: assets]
|
||||||
# The base directory where assets are stored. This is used to determine the
|
# The base directory where assets are stored. This is used to determine the
|
||||||
# `dirname` value in `output_path_format` below.
|
# `dirname` value in `output_path_format` below.
|
||||||
|
|
|
@ -9,7 +9,8 @@ module Jekyll
|
||||||
'extra_images' => [],
|
'extra_images' => [],
|
||||||
'auto_rotate' => false,
|
'auto_rotate' => false,
|
||||||
'save_to_source' => true,
|
'save_to_source' => true,
|
||||||
'cache' => false
|
'cache' => false,
|
||||||
|
'strip' => false
|
||||||
}
|
}
|
||||||
|
|
||||||
def initialize(site)
|
def initialize(site)
|
||||||
|
|
|
@ -36,6 +36,9 @@ module Jekyll
|
||||||
|
|
||||||
Jekyll.logger.info "Generating #{target_filepath}"
|
Jekyll.logger.info "Generating #{target_filepath}"
|
||||||
|
|
||||||
|
if config['strip']
|
||||||
|
img.strip!
|
||||||
|
end
|
||||||
i = img.scale(ratio)
|
i = img.scale(ratio)
|
||||||
i.write(target_filepath) do |f|
|
i.write(target_filepath) do |f|
|
||||||
f.interlace = i.interlace
|
f.interlace = i.interlace
|
||||||
|
|
Loading…
Reference in New Issue