Release Notes
⚠️ BREAKING CHANGES
- core:
Resize is the full request of ADR-0009 (size, fit, position, background, enlarge, filter) instead of max_width and max_height. Resize::inside(width, height) builds the old bounds, and Resize::fit returns an Option<Geometry> instead of an Option<(u32, u32)>; the output size is Geometry::output
- sqzer:
Sqzer::transform returns a Ready, and Sqzer::encode, encode_with and pick_format take one (ADR-0010). A caller that encoded a Decoded directly calls Sqzer::prepare then Prepared::resize, or Sqzer::transform, first
Features
- cli: resize flags of ADR-0009:
--width and --height with --fit inside|cover|contain|fill|outside in CSS object-fit terms, outside setting the shortest side with a square box (ADR-0010), --position for where cover crops and contain places the image, --background for the padding of contain (a translucent one needs a format with alpha, else exit 3), --scale 50%, --enlarge to allow scaling up, and --filter (lanczos3, mitchell, catmull-rom, bilinear, box, nearest). --max-width and --max-height behave as before
- cli:
--width 480,960,1600 writes one output per width and format from one decode, named photo-480w.avif and so on for srcset, each width searched on its own. Widths that come out the same size are refused before anything is encoded
- cli: a dry run shows what a resize crops or pads,
48x32 -> 16x16 crop 32x32 at 0,0
- cli: the
rimage hint translates --resize specs into the new flags, --enlarge included unless the command passed --no-upscale
- core: the resize geometry of ADR-0009 as pure functions:
Resize::fit gives the crop of a cover fit, the resampled size and the canvas of a contain fit, for the dry run and the pipeline alike
- sqzer: a type per stage, ADR-0010:
Sqzer::prepare returns a Prepared once per input, Prepared::resize a Ready once per size, so several sizes come from one decode and one colour conversion. encode pads a contain fit with the background its encoder calls for, transparent where it takes alpha and white where it does not, and refuses a translucent one on an encoder without alpha with Error::Unsupported
Bug Fixes
- cli:
-f png,png, and a --template without {ext} or {format} under several -f formats, are argument errors instead of writing one file over another
Install sqzer-cli 0.2.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/sqzer-dev/sqzer/releases/download/v0.2.0/sqzer-cli-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/sqzer-dev/sqzer/releases/download/v0.2.0/sqzer-cli-installer.ps1 | iex"
Install prebuilt binaries via Homebrew
brew install sqzer-dev/tap/sqzer
Download sqzer-cli 0.2.0