Skip to content

Commit

Permalink
Add option to strip EXIF profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
driehuis committed Jan 19, 2018
1 parent c9da267 commit 826b5f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion lib/jekyll-responsive-image/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class Config
'extra_images' => [],
'auto_rotate' => false,
'save_to_source' => true,
'cache' => false
'cache' => false,
'strip' => false
}

def initialize(site)
Expand Down
3 changes: 3 additions & 0 deletions lib/jekyll-responsive-image/resize_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def resize_image(img, config)

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
Expand Down

0 comments on commit 826b5f7

Please sign in to comment.