@oim-media/spec 1.32.4 → 1.33.0
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.
- package/BINARY_SPEC.md +2 -10
- package/CANONICAL_SPEC.md +1 -1
- package/README.md +3 -0
- package/package.json +1 -1
- package/schema/oim.schema.json +2 -2
- package/schema/ovm.schema.json +2 -2
- package/tools/parity.mjs +7 -3
- package/vectors-2/golden/accessibility.web.png +0 -0
- package/vectors-2/golden/artistic-text.web.png +0 -0
- package/vectors-2/golden/asymmetric-borders.web.png +0 -0
- package/vectors-2/golden/basic-text.web.png +0 -0
- package/vectors-2/golden/color-blending-opacity.web.png +0 -0
- package/vectors-2/golden/crop.web.png +0 -0
- package/vectors-2/golden/embedded-font-woff.web.png +0 -0
- package/vectors-2/golden/extreme-aspect-ratios.web.png +0 -0
- package/vectors-2/golden/filter-effects.web.png +0 -0
- package/vectors-2/golden/filter-shape.web.png +0 -0
- package/vectors-2/golden/flip.web.png +0 -0
- package/vectors-2/golden/frame-shapes.web.png +0 -0
- package/vectors-2/golden/full-monty-composite.web.png +0 -0
- package/vectors-2/golden/groups-and-parallax.web.png +0 -0
- package/vectors-2/golden/image-fill.web.png +0 -0
- package/vectors-2/golden/interactive-chained-actions.web.png +0 -0
- package/vectors-2/golden/interactive-hover.web.png +0 -0
- package/vectors-2/golden/interactive.web.png +0 -0
- package/vectors-2/golden/layer-blur.web.png +0 -0
- package/vectors-2/golden/layer-grain.web.png +0 -0
- package/vectors-2/golden/layer-ordering-zindex.web.png +0 -0
- package/vectors-2/golden/legacy-text-chunk.web.png +0 -0
- package/vectors-2/golden/mask-frame-fill.web.png +0 -0
- package/vectors-2/golden/mask-window.web.png +0 -0
- package/vectors-2/golden/media-filters.web.png +0 -0
- package/vectors-2/golden/multi-container-layout.web.png +0 -0
- package/vectors-2/golden/multilang-cjk-rtl.web.png +0 -0
- package/vectors-2/golden/nested-groups.web.png +0 -0
- package/vectors-2/golden/palettes.web.png +0 -0
- package/vectors-2/golden/parallax-infinite.web.png +0 -0
- package/vectors-2/golden/pattern-color-roles.web.png +0 -0
- package/vectors-2/golden/reedit-english.web.png +0 -0
- package/vectors-2/golden/reveal-and-play.web.png +0 -0
- package/vectors-2/golden/shadow-effects.web.png +0 -0
- package/vectors-2/golden/shape-shadows.web.png +0 -0
- package/vectors-2/golden/strokes-and-borders.web.png +0 -0
- package/vectors-2/golden/text-runs-precalculated.web.png +0 -0
- package/vectors-2/golden/transparent-background.web.png +0 -0
- package/vectors-2/golden/typography-styling.web.png +0 -0
- package/vectors-2/golden/zone-group.web.png +0 -0
package/BINARY_SPEC.md
CHANGED
|
@@ -50,17 +50,9 @@ OIM metadata is preferably stored in an ancillary text chunk:
|
|
|
50
50
|
|
|
51
51
|
Writers since 1.30.0 put it **after** the last `IDAT`, so the image arrives first.
|
|
52
52
|
|
|
53
|
-
### 2.3. Poster seal (`OIM_Seal`,
|
|
53
|
+
### 2.3. Poster seal (`OIM_Seal`, 1.30.0 to 1.32.x, retired in 1.33.0)
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{"v":1,"alg":"sha256-idat","image_hash":"<hex SHA-256 of the concatenated IDAT payloads>","key_version":"v2","signature":"<base64 raw P-256 r||s>"}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
- **Signed bytes:** `JSON.stringify` of `{alg, image_hash, key_version, v}` with keys in that (sorted) order; ECDSA P-256 / SHA-256 with the key named by `key_version`. Its signed fields differ from the metadata's, so neither signature passes as the other.
|
|
62
|
-
- **Use:** a reader may stop after this chunk, verify `image_hash` against the `IDAT` it read and the signature, and show the image as a poster without reading the metadata. The same key-expiry rules apply.
|
|
63
|
-
- **Optional:** readers that do not know it ignore it; a file without it is read whole, as before.
|
|
55
|
+
Writers from 1.30.0 to 1.32.x put a `tEXt` chunk `OIM_Seal` between the last `IDAT` and the metadata: a signed hash of the image, so a reader could show it as a verified poster before reading the rest. It is retired in 1.33.0: writers no longer emit it and readers **must ignore** it. The image is still sealed by the metadata's `image_hash` (see section 4), and a PNG shown before verification runs nothing, so a poster needs no seal of its own.
|
|
64
56
|
|
|
65
57
|
> **Critical note on injection:** The metadata chunk must be inserted **surgically at byte level** into the PNG binary stream, without re-rendering or re-encoding the `IDAT` blocks, preserving the exact cryptographic hash of the canvas.
|
|
66
58
|
|
package/CANONICAL_SPEC.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OIM (Object Interactive Media) Canonical Metadata Specification
|
|
2
2
|
|
|
3
|
-
**Contract version:** 1.
|
|
3
|
+
**Contract version:** 1.33.0
|
|
4
4
|
**Date:** 2026-11-02 (reviewed against `packages/core/src/schema.ts`; the source of truth is the schema, this document summarises it)
|
|
5
5
|
**Status:** Normative / In force
|
|
6
6
|
**License:** Apache-2.0
|
package/README.md
CHANGED
|
@@ -19,6 +19,9 @@ tools/ Read-only checks: contract-summary.mjs, canonical-check.mjs,
|
|
|
19
19
|
Published as `@oim-media/spec`. The tarball carries the schema, the vectors, both
|
|
20
20
|
specifications, `keys.json`, `marks-cases.json`, this README, LICENSE and NOTICE.
|
|
21
21
|
|
|
22
|
+
|
|
23
|
+
**2.0 rendering rules:** [SPEC_2.md](SPEC_2.md).
|
|
24
|
+
|
|
22
25
|
## Versioning
|
|
23
26
|
|
|
24
27
|
`CONTRACT_VERSION` in `packages/core/src/compatibility.ts` is the version of the
|
package/package.json
CHANGED
package/schema/oim.schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://oim.media/spec/1.
|
|
3
|
+
"$id": "https://oim.media/spec/1.33.0/oim.schema.json",
|
|
4
4
|
"title": "OIM document metadata",
|
|
5
|
-
"specVersion": "1.
|
|
5
|
+
"specVersion": "1.33.0",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"description": {
|
package/schema/ovm.schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://oim.media/spec/1.
|
|
3
|
+
"$id": "https://oim.media/spec/1.33.0/ovm.schema.json",
|
|
4
4
|
"title": "OVM document metadata",
|
|
5
|
-
"specVersion": "1.
|
|
5
|
+
"specVersion": "1.33.0",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"ovm_version": {
|
package/tools/parity.mjs
CHANGED
|
@@ -36,7 +36,9 @@ export const runParity = ({
|
|
|
36
36
|
const exceptionsFile = path.join(goldenDir, 'exceptions.json');
|
|
37
37
|
const exceptions = (fs.existsSync(exceptionsFile) ? JSON.parse(fs.readFileSync(exceptionsFile, 'utf8')) : {})[renderer] ?? {};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// A vector this renderer skips needs no golden yet: its blocks are not painted by anyone in this set.
|
|
40
|
+
const skipped = (v) => fs.existsSync(path.join(rendersDir, `${v}.skipped`));
|
|
41
|
+
for (const v of vectors) if (!goldens.includes(v) && !skipped(v)) failures.push(`${v}: no golden for this vector, regenerate the goldens`);
|
|
40
42
|
for (const g of goldens) if (!vectors.includes(g)) failures.push(`${g}: orphan golden, no vector`);
|
|
41
43
|
for (const e of Object.keys(exceptions)) if (!vectors.includes(e)) failures.push(`${e}: unknown vector in exceptions`);
|
|
42
44
|
if (outDir) fs.mkdirSync(outDir, { recursive: true });
|
|
@@ -82,10 +84,12 @@ if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.a
|
|
|
82
84
|
const flag = (n) => { const i = args.indexOf(n); return i >= 0 ? args[i + 1] : undefined; };
|
|
83
85
|
const rendersDir = args[0], renderer = flag('--renderer');
|
|
84
86
|
if (!rendersDir || !renderer) {
|
|
85
|
-
console.error('usage: parity.mjs <renders-dir> --renderer <name> [--out <diff-dir>]');
|
|
87
|
+
console.error('usage: parity.mjs <renders-dir> --renderer <name> [--out <diff-dir>] [--golden-dir <dir>] [--vectors-dir <dir>]');
|
|
86
88
|
process.exit(2);
|
|
87
89
|
}
|
|
88
|
-
|
|
90
|
+
// The 2.0 painters are gated by the 2.0 goldens (vectors-2/golden), not by the 1.x ones.
|
|
91
|
+
const dirs = Object.fromEntries([['goldenDir', flag('--golden-dir')], ['vectorsDir', flag('--vectors-dir')]].filter(([, v]) => v));
|
|
92
|
+
const { failures, lines } = runParity({ rendersDir, renderer, outDir: flag('--out'), ...dirs });
|
|
89
93
|
lines.forEach((l) => console.log(l));
|
|
90
94
|
failures.forEach((f) => console.error(`✖ ${f}`));
|
|
91
95
|
console.log(failures.length ? `\n${failures.length} failure(s)` : '\nvisual parity: OK');
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|