Skip to content

Commit

Permalink
Add fill, focus_x, and focus_y arguments to the `video_thumbnai…
Browse files Browse the repository at this point in the history
…l_tile` processing option
  • Loading branch information
DarthSim committed Apr 26, 2024
1 parent 1550076 commit 0da4b82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Added
- Add `smart_subsample` argument to the `webp_options` processing option.
- Add `watermark_rotate` processing option support.
- Add `fill`, `focus_x`, and `focus_y` arguments to the `video_thumbnail_tile` processing option.

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions lib/imgproxy/options_casters/video_thumbnail_tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module VideoThumbnailTile
tile_height: Imgproxy::OptionsCasters::Integer,
extend_tile: Imgproxy::OptionsCasters::Bool,
trim: Imgproxy::OptionsCasters::Bool,
fill: Imgproxy::OptionsCasters::Bool,
focus_x: Imgproxy::OptionsCasters::Float,
focus_y: Imgproxy::OptionsCasters::Float,
).freeze

def self.cast(raw)
Expand Down
7 changes: 5 additions & 2 deletions spec/url_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@
tile_height: 100,
extend_tile: true,
trim: true,
fill: true,
focus_x: 0.25,
focus_y: 0.75,
},
fallback_image_url: "https://images.test/fallback.jpg",
skip_processing: %w[gif svg],
Expand Down Expand Up @@ -277,7 +280,7 @@
"da:1",
"vts:15",
"vtk:1",
"vtt:1.5:2:3:200:100:1:1",
"vtt:1.5:2:3:200:100:1:1:1:0.25:0.75",
"fiu:aHR0cHM6Ly9pbWFnZXMudGVzdC9mYWxsYmFjay5qcGc",
"skp:gif:svg",
"raw:1",
Expand Down Expand Up @@ -352,7 +355,7 @@
"disable_animation:1",
"video_thumbnail_second:15",
"video_thumbnail_keyframes:1",
"video_thumbnail_tile:1.5:2:3:200:100:1:1",
"video_thumbnail_tile:1.5:2:3:200:100:1:1:1:0.25:0.75",
"fallback_image_url:aHR0cHM6Ly9pbWFnZXMudGVzdC9mYWxsYmFjay5qcGc",
"skip_processing:gif:svg",
"raw:1",
Expand Down

0 comments on commit 0da4b82

Please sign in to comment.