Skip to content

Add --window: export one photograph through a window chosen elsewhere - #4

Merged
oddharsh merged 1 commit into
mainfrom
crop-window
Nov 7, 2026
Merged

oddharsh merged 1 commit into
mainfrom
crop-window

Conversation

@oddharsh

@oddharsh oddharsh commented Nov 7, 2026

Copy link
Copy Markdown
Owner

--pick chooses a window in the browser and exports it through geometry::plan_window. --window x,y,w,h takes the same window in oriented source pixels from the command line, so a crop chosen somewhere else (here, a contact sheet of candidate crops) exports without opening the page.

pick::export now takes the decoded image rather than the browser session's frame, and both paths call it. The window gets the same checks as a picked one: whole pixels, inside the frame, inside the 3:4 to 1.91:1 band, never enlarged.

--window refuses --raw, --pick, --check, --dry-run, --variants, and more than one photograph. A RAW never applies here, same as under --pick.

Checked

  • On the 11-1 cut HIFs: 0,811,7728,4046 on a 7728x5152 frame exported 3072x1608; 412,773,3091,3091 and 0,2061,5152,5152 on 5152x7728 frames exported 3072x3072. Each matched its contact-sheet preview.
  • cargo test --release (78 pass, including a new parse_window test), cargo clippy --all-targets --locked -- -D warnings and cargo fmt --check are clean.

--pick decides a window in the browser and exports it through
geometry::plan_window. --window takes the same x,y,w,h in oriented
source pixels from the command line, so a crop chosen on a contact
sheet exports without opening the page. pick::export now takes the
decoded image instead of the browser session's frame, and both paths
call it.

Checked on the 11-1 cut: 0,811,7728,4046 on a 7728x5152 HIF exports
3072x1608, and 412,773,3091,3091 on a 5152x7728 HIF exports 3072x3072.
--window refuses --raw, --pick, --check, --dry-run, --variants and more
than one photograph.
@oddharsh
oddharsh merged commit 0fd64c9 into main Nov 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant