We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
aspect
1 parent 2b3db06 commit 25d8377Copy full SHA for 25d8377
packages/imago/src/path.ts
@@ -31,6 +31,7 @@ const _ = undefined;
31
* - sha1/224/256/384/512: truncated hash of output
32
* - w: current width
33
* - h: current height
34
+ * - aspect: "p" (portrait), "l" (landscape) or "sq" (square)
35
* - date: yyyyMMdd
36
* - time: HHmmss
37
* - year: 4-digit year
@@ -79,6 +80,10 @@ export const formatPath = (
79
80
return String(ctx.size[0]);
81
case "h":
82
return String(ctx.size[1]);
83
+ case "aspect": {
84
+ const [w, h] = ctx.size;
85
+ return w > h ? "l" : w < h ? "p" : "sq";
86
+ }
87
case "date":
88
return FMT_yyyyMMdd_ALT(_, true);
89
case "time":
0 commit comments