Fix planFrame ComposeOptions for exactOptionalPropertyTypes (BIT-32879).
ci / typescript (pull_request) Failing after 2m10s
ci / rust (pull_request) Successful in 5m34s

This commit is contained in:
spark committed 2026-11-22 15:02:08 +00:00
1 parent 1fb6ca171d
commit f04b61e279
1 file changed
+42 -4
+42 -4
View File
@@ -148,15 +148,53 @@ export function planFrame(input: {
// The photograph's own aspect. A preset (4:5, 16:9, a portrait of a landscape frame) is not used.
const aspect = null;
const minWidth = minCropWidth(W, H, settings.minLongEdge);
const context = reportage ? "reportage" : "sport";
const context: "sport" | "reportage" = reportage ? "reportage" : "sport";
const faces = input.faces ?? [];
const focus = input.focus ?? null;
const sport = input.sport ?? null;
const lens = input.lens ?? null;
const edgeClutter = input.edgeClutter;
const composition = detections ? compose(detections, aspect, { minWidth, focus, framing: settings.framing, context, faces, sport, lens, edgeClutter }) : null;
const wideComposition = detections && !reportage && settings.framing === "tight" ? compose(detections, aspect, { minWidth, focus, framing: "full", context: "sport", sport, edgeClutter }) : null;
const plans = reportage && detections ? { half: planCrop(detections, "half", aspect, { minWidth, focus, context, faces, edgeClutter }), threeQuarter: planCrop(detections, "threeQuarter", aspect, { minWidth, focus, context, faces, edgeClutter }) } : null;
const composition = detections
? compose(detections, aspect, {
minWidth,
focus,
framing: settings.framing,
context,
faces,
sport,
lens,
...(edgeClutter ? { edgeClutter } : {}),
})
: null;
const wideComposition =
detections && !reportage && settings.framing === "tight"
? compose(detections, aspect, {
minWidth,
focus,
framing: "full",
context: "sport",
sport,
...(edgeClutter ? { edgeClutter } : {}),
})
: null;
const plans = reportage && detections
? {
half: planCrop(detections, "half", aspect, {
minWidth,
focus,
context,
faces,
...(edgeClutter ? { edgeClutter } : {}),
}),
threeQuarter: planCrop(detections, "threeQuarter", aspect, {
minWidth,
focus,
context,
faces,
...(edgeClutter ? { edgeClutter } : {}),
}),
}
: null;
let crop: Box | null = null;
let angle = input.angle;
if (settings.crop && composition) {