@escape-game-over/atlas 0.1.34 → 0.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,11 +22,16 @@ So **1200×630 for everything**, and let the square surfaces crop.
22
22
 
23
23
  That crop is the whole reason `shareImage` takes a fit at all:
24
24
 
25
- | The page's art | `shareImage` call | Why |
26
- | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------ |
27
- | A photograph | `shareImage(src)` — `cover` | edges are scenery; a square crop takes the middle, which is the subject |
28
- | A logo, square source | `shareImage(src, { fit: "contain", background })` | scaled to 630×630 and centred, so a square crop lands **exactly on the logo** |
29
- | A logo under ~630px | neither — compose one or get a bigger file | `contain` would enlarge it, and `shareImage` refuses rather than ship a blurred card |
25
+ | The page's art | `shareImage` call | Why |
26
+ | --------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
27
+ | A photograph | `shareImage(src)` — `cover`, `jpeg` | edges are scenery; a square crop takes the middle, which is the subject |
28
+ | A logo, square source | `shareImage(src, { fit: "contain", background, format: "png" })` | scaled to 630×630 and centred, so a square crop lands **exactly on the logo** |
29
+ | A logo under ~630px | neither — compose one or get a bigger file | `contain` would enlarge it, and `shareImage` refuses rather than ship a blurred card |
30
+
31
+ The format follows the art, not the surface. A photograph is `jpeg`, the default:
32
+ as `png` it runs to 1–2MB, and WhatsApp shows no preview for an image past
33
+ about 300kB. A logo on a flat field is `png`, which is smaller and sharper for
34
+ flat colour than `jpeg`'s blocks.
30
35
 
31
36
  Both examples use the second row for their catalogue pages: a room's own mark on
32
37
  the brand field, so a chat thumbnail shows which room it is rather than a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
@@ -54,7 +54,7 @@
54
54
  "@biomejs/biome": "2.5.14",
55
55
  "@types/node": "26.6.2",
56
56
  "@vitest/coverage-istanbul": "5.0.1",
57
- "astro": "7.3.4",
57
+ "astro": "7.3.5",
58
58
  "typescript": "6.0.3",
59
59
  "vitest": "5.0.1"
60
60
  }
@@ -30,9 +30,11 @@ interface ShareImageBase {
30
30
  /** Defaults to 630. */
31
31
  readonly height?: number;
32
32
  /**
33
- * Defaults to `png`: lossless, and accepted by every scraper. `jpeg` is far
34
- * smaller for photographs. Avoid `avif`, which several scrapers still
35
- * cannot read.
33
+ * Defaults to `jpeg`: accepted by every scraper, and a 1200×630 photograph
34
+ * lands near 150kB where `png` makes it 1–2MB — past the ~300kB WhatsApp
35
+ * will fetch for a preview at all. Ask for `png` for flat art, a logo on
36
+ * its field, where it is both smaller and sharper. Avoid `avif`, which
37
+ * several scrapers still cannot read.
36
38
  */
37
39
  readonly format?: "png" | "jpeg" | "webp";
38
40
  /** Ignored by `png`, which is lossless. */
@@ -146,7 +148,7 @@ export async function shareImage(
146
148
  ): Promise<ImageAsset> {
147
149
  const width = options.width ?? SHARE_WIDTH;
148
150
  const height = options.height ?? SHARE_HEIGHT;
149
- const format = options.format ?? "png";
151
+ const format = options.format ?? "jpeg";
150
152
  const fit = options.fit ?? "cover";
151
153
 
152
154
  // Astro's image service never enlarges: ask for a box bigger than the