Skip to content

Commit

Permalink
Add smart_subsample argument to the webp_options processing option
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthSim committed Feb 10, 2024
1 parent 8be3289 commit ef83e95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
-->
# Changelog

## [Unreleased]
### Added
- Add `smart_subsample` argument to the `webp_options` processing option.

## [3.0.0] - 2023-12-28

⚠️ This is a major release. See [the migration guide](https://github.com/imgproxy/imgproxy.rb/blob/master/UPGRADE.md). ⚠️
Expand Down
1 change: 1 addition & 0 deletions lib/imgproxy/options_casters/webp_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module OptionsCasters
module WebpOptions
CASTER = Imgproxy::OptionsCasters::Group.new(
compression: Imgproxy::OptionsCasters::String,
smart_subsample: Imgproxy::OptionsCasters::Bool,
).freeze

def self.cast(raw)
Expand Down
5 changes: 3 additions & 2 deletions spec/url_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
},
webp_options: {
compression: "lossless",
smart_subsample: true,
},
format: :webp,
page: 42,
Expand Down Expand Up @@ -268,7 +269,7 @@
"mb:1024",
"jpego:1:0:1:0:1:5",
"pngo:0:1:128",
"webpo:lossless",
"webpo:lossless:1",
"pg:42",
"pgs:2",
"da:1",
Expand Down Expand Up @@ -342,7 +343,7 @@
"max_bytes:1024",
"jpeg_options:1:0:1:0:1:5",
"png_options:0:1:128",
"webp_options:lossless",
"webp_options:lossless:1",
"page:42",
"pages:2",
"disable_animation:1",
Expand Down

0 comments on commit ef83e95

Please sign in to comment.