Repository navigation
feat(wasm): options(), the keys of optimize and encode with their defaults and help - #60
Merged
Merged
Conversation
|
…aults and help The page at sqzer.dev shows each control at the package's default and read the defaults from the README by hand. `codecs()` already reports every backend option with its default and help; `options()` does the same for the keys of `optimize` and `encode`, in the shape of `CodecOption`. The defaults are read from the builder an encode without options uses, so they cannot drift; a key whose default depends on the image or the format says `auto`, and one that does nothing when left out has none. The key table that feeds the listing is the one a misspelt key is checked against. Closes #57 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
vlad-salone
force-pushed
the
feat/wasm-options-listing
branch
2 times, most recently
from
October 13, 2026 13:06
fabc59f to
a1bf71a
Compare
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.
Closes #57. One entry per key of
Options, in the shape ofCodecOption, from a newoptions()export.The defaults are not written down a second time. The listing reads them from the builder an encode without options starts from,
params()andresize_bounds()of the package'sSqzer, and spells them the way the options take them, soeffortsays6becauseEncodeParams::defaultdoes. Where the default depends on the image or the format,formatandbackground, the entry saysauto, asavif:alpha_qualitydoes. Where leaving the key out means not doing the thing,width,scale,preset,quality,codecOpts,onTrial, the entry has nodefaultrather than an invented one, andsqzer.d.tshas it as optional.The key list that
options()walks is the same one a misspelt key is refused against, so the two cannot drift; the test checks that the refusal for an unknown key names every listed key, that the listed defaults are the ones above, and that an encode with no options lands on them.Not done here:
sqzer-dev/sqzer.dev#19drops the page'sdefaults.tsonce this is released.Checked locally:
cargo clippy --workspace --all-targets --all-features,cargo docwith warnings denied, andwasm-pack test --node, 17 tests.pack.shand the tarball run are left to the wasm job of CI.🤖 Generated with Claude Code