diff --git a/README.md b/README.md index 07cc999..0741736 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/jekyll-responsive-image/config.rb b/lib/jekyll-responsive-image/config.rb index 7d4f368..3880abd 100644 --- a/lib/jekyll-responsive-image/config.rb +++ b/lib/jekyll-responsive-image/config.rb @@ -9,7 +9,8 @@ module Jekyll 'extra_images' => [], 'auto_rotate' => false, 'save_to_source' => true, - 'cache' => false + 'cache' => false, + 'strip' => false } def initialize(site) diff --git a/lib/jekyll-responsive-image/resize_handler.rb b/lib/jekyll-responsive-image/resize_handler.rb index bc86b68..9f9f5bc 100644 --- a/lib/jekyll-responsive-image/resize_handler.rb +++ b/lib/jekyll-responsive-image/resize_handler.rb @@ -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