Repository navigation
[bugfix] Give a usage error for out of range --frame-window and save-images size options - #610
Merged
Breakthrough merged 2 commits intoNov 17, 2026
Conversation
Owner
|
LGTM, thank you for finding this! We should probably take a look to see if there are other related issues for similar asserts. |
Breakthrough
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #609
detect-adaptive -f/--frame-windowandsave-images-n/--num-images,-s/--scale,-H/--heightand-W/--widthaccepted any value, and values the code can't use ended in a traceback. The config file had the same gap.This makes these keys
RangeValues inCONFIG_MAPand uses_click_rangefor the CLI options, likemin-images,max-imagesandcompression:frame-windowandnum-images: at least 1scale,height,width: at least 0, since 0 already means not setA bad value now gives a usage error on the command line and a config load error in a config file. Valid values and defaults don't change, and the generated CLI docs are the same.
Tests:
test_cli_option_out_of_rangeandtest_cli_config_file_option_out_of_rangeintests/test_cli.py.ruff check,ruff formatandpyrightpass. The full suite passes apart fromtest_write_scene_list_ffmetadata_ffmpeg_roundtrip, which fails the same way on main on my machine (Windows, no ffmpeg on PATH).