Fix planFrame ComposeOptions for exactOptionalPropertyTypes (BIT-32879).
This commit is contained in:
1 parent
1fb6ca171d
commit
f04b61e279
1 file changed
+42
-4
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user