Skip to content

Commit a964d56

Browse files
committed
Render soft bing alg list into table view
1 parent 9d35b29 commit a964d56

File tree

4 files changed

+274
-0
lines changed

4 files changed

+274
-0
lines changed

docs/soft-bindings.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
id: sb-algs
3+
title: Soft binding algorithm list
4+
hide_table_of_contents: true
5+
---
6+
7+
C2PA specifies a mechanism for recovering a C2PA Manifest for an asset, for example when the metadata containing the C2PA Manifest has been stripped. This mechanism is a [soft binding](https://c2pa.org/specifications/specifications/2.0/specs/C2PA_Specification.html#_soft_binding) (for example an invisible watermark or content fingerprint). The soft binding is used to look-up the C2PA Manifest within a Manifest Repository. The soft binding is described by the [soft binding assertion](https://c2pa.org/specifications/specifications/2.0/specs/C2PA_Specification.html#_soft_bindings).
8+
9+
The soft binding assertion contains a field `alg` that serves to uniquely identify the algorithm used to compute the soft binding. The Soft Binding Algorithm List is an authoritative list of soft binding algorithm names that may be used as identifiers within the `alg` field. Entries in the list also contain additional information on the algorithms.
10+
11+
import JSONToTable from '@site/src/components/JSONToTable';
12+
13+
This table is generated from a static JSON file.
14+
15+
<JSONToTable />

sidebars.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ const sidebars = {
267267
label: 'Task planning & roadmap',
268268
id: 'roadmap',
269269
},
270+
{
271+
type: 'doc',
272+
label: 'Soft binding algorithm list',
273+
id: 'sb-algs',
274+
},
270275
],
271276
};
272277

src/components/JSONToTable.js

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import React, { useState, useEffect } from 'react';
2+
3+
// Helper function to flatten nested objects
4+
const flattenObject = (obj, prefix = '') => {
5+
let result = {};
6+
for (const key in obj) {
7+
if (obj.hasOwnProperty(key)) {
8+
const newKey = prefix ? `${prefix}.${key}` : key;
9+
10+
// Handle nested objects
11+
if (typeof obj[key] === 'object' && obj[key] !== null) {
12+
if (Array.isArray(obj[key])) {
13+
// If it's an array, join its elements into a comma-delimited string
14+
result[newKey] = obj[key].join(', ');
15+
} else {
16+
// If it's an object, recurse to flatten it
17+
Object.assign(result, flattenObject(obj[key], newKey));
18+
}
19+
} else {
20+
result[newKey] = obj[key];
21+
}
22+
}
23+
}
24+
return result;
25+
};
26+
27+
const JSONToTable = () => {
28+
const [jsonData, setJsonData] = useState(null);
29+
const [error, setError] = useState(null);
30+
31+
// Fetch the JSON data when the component mounts
32+
useEffect(() => {
33+
fetch('/sb-alg-list.json') // Path to the JSON file in the static folder
34+
.then((response) => {
35+
if (!response.ok) {
36+
throw new Error('Failed to fetch the JSON file');
37+
}
38+
return response.json();
39+
})
40+
.then((data) => {
41+
setJsonData(data);
42+
setError(null); // Clear any previous errors
43+
})
44+
.catch((err) => {
45+
setError(err.message);
46+
setJsonData(null); // Reset data in case of error
47+
});
48+
}, []);
49+
50+
// Function to generate table headers dynamically
51+
const generateTableHeaders = (data) => {
52+
if (data && Array.isArray(data)) {
53+
const flattenedData = data.map((item) => flattenObject(item));
54+
const keys = Array.from(new Set(flattenedData.flatMap(Object.keys)));
55+
return keys.map((key) => <th key={key}>{key}</th>);
56+
}
57+
return [];
58+
};
59+
60+
// Function to generate table rows dynamically
61+
const generateTableRows = (data) => {
62+
console.log(data);
63+
if (data && Array.isArray(data)) {
64+
const flattenedData = data.map((item) => flattenObject(item));
65+
return flattenedData.map((row, rowIndex) => (
66+
<tr key={rowIndex}>
67+
{Object.values(row).map((value, index) => (
68+
<td key={index}>{value}</td>
69+
))}
70+
</tr>
71+
));
72+
}
73+
return [];
74+
};
75+
76+
return (
77+
<div>
78+
{error && <p style={{ color: 'red' }}>{error}</p>}
79+
80+
{jsonData && Array.isArray(jsonData) && (
81+
<table border="1" style={{ width: '100%', borderCollapse: 'collapse' }}>
82+
<thead>
83+
<tr>{generateTableHeaders(jsonData)}</tr>
84+
</thead>
85+
<tbody>{generateTableRows(jsonData)}</tbody>
86+
</table>
87+
)}
88+
89+
{jsonData && !Array.isArray(jsonData) && (
90+
<p>No data found in the JSON. Expected an array of objects.</p>
91+
)}
92+
</div>
93+
);
94+
};
95+
96+
export default JSONToTable;

static/sb-alg-list.json

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
[
2+
{
3+
"identifier": 1,
4+
"alg": "com.digimarc.validate.1",
5+
"type": "watermark",
6+
"decodedMediaTypes": ["audio", "video", "text", "image"],
7+
"entryMetadata": {
8+
"description": "Digimarc Validate Digital Watermarking algorithm",
9+
"dateEntered": "2024-05-17T17:00:00.000Z",
10+
"contact": "[email protected]",
11+
"informationalUrl": "https://www.digimarc.com/products/digital-content-authentication"
12+
}
13+
},
14+
{
15+
"identifier": 2,
16+
"alg": "org.atsc.a336",
17+
"type": "watermark",
18+
"decodedMediaTypes": ["audio", "video", "image"],
19+
"entryMetadata": {
20+
"description": "ATSC watermarking (A/334, A/335, A/336)",
21+
"dateEntered": "2024-05-17T15:43:00.000Z",
22+
"contact": "[email protected]",
23+
"informationalUrl": "https://www.atsc.org/atsc-documents/a3362017-content-recovery-redistribution-scenarios/"
24+
}
25+
},
26+
{
27+
"identifier": 3,
28+
"alg": "io.iscc.v0",
29+
"type": "fingerprint",
30+
"decodedMediaTypes": ["text", "image", "audio", "video", "application"],
31+
"entryMetadata": {
32+
"description": "ISO 24138 - International Standard Content Code (ISCC) V0 algorithm",
33+
"dateEntered": "2024-05-17T16:00:00Z",
34+
"contact": "[email protected]",
35+
"informationalUrl": "https://www.iso.org/standard/77899.html"
36+
}
37+
},
38+
{
39+
"identifier": 4,
40+
"alg": "com.adobe.trustmark.Q",
41+
"type": "watermark",
42+
"decodedMediaTypes": ["image"],
43+
"entryMetadata": {
44+
"description": "Adobe Trustmark variant Q",
45+
"dateEntered": "2024-05-17T17:00:00.000Z",
46+
"contact": "[email protected]",
47+
"informationalUrl": "https://github.com/adobe/trustmark/"
48+
}
49+
},
50+
{
51+
"identifier": 5,
52+
"alg": "com.adobe.trustmark.C",
53+
"type": "watermark",
54+
"decodedMediaTypes": ["image"],
55+
"entryMetadata": {
56+
"description": "Adobe Trustmark variant C",
57+
"dateEntered": "2024-05-17T17:00:00.000Z",
58+
"contact": "[email protected]",
59+
"informationalUrl": "https://github.com/adobe/trustmark/"
60+
}
61+
},
62+
{
63+
"identifier": 6,
64+
"alg": "com.adobe.icn.dense",
65+
"type": "fingerprint",
66+
"decodedMediaTypes": ["image"],
67+
"entryMetadata": {
68+
"description": "Adobe Image Comparator Network Dense Fingerprint",
69+
"dateEntered": "2024-05-17T17:00:00.000Z",
70+
"contact": "[email protected]",
71+
"informationalUrl": "https://openaccess.thecvf.com/content/CVPR2021W/WMF/html/Black_Deep_Image_Comparator_Learning_To_Visualize_Editorial_Change_CVPRW_2021_paper.html"
72+
}
73+
},
74+
{
75+
"identifier": 7,
76+
"alg": "ai.steg.api",
77+
"type": "watermark",
78+
"decodedMediaTypes": ["image", "video", "application"],
79+
"entryMetadata": {
80+
"description": "Steg.AI invisible watermarking",
81+
"dateEntered": "2024-05-20T10:50:00.000Z",
82+
"contact": "[email protected]",
83+
"informationalUrl": "https://openaccess.thecvf.com/content_CVPR_2019/papers/Wengrowski_Light_Field_Messaging_With_Deep_Photographic_Steganography_CVPR_2019_paper.pdf"
84+
}
85+
},
86+
{
87+
"identifier": 8,
88+
"alg": "ai.trufo.gen1.image",
89+
"type": "watermark",
90+
"decodedMediaTypes": ["image"],
91+
"entryMetadata": {
92+
"description": "Trufo image watermark.",
93+
"dateEntered": "2024-08-14T15:00:00.000Z",
94+
"contact": "[email protected]",
95+
"informationalUrl": "https://trufo.ai/publications/"
96+
}
97+
},
98+
{
99+
"identifier": 9,
100+
"alg": "ai.trufo.gen1.image-lite",
101+
"type": "watermark",
102+
"decodedMediaTypes": ["image"],
103+
"entryMetadata": {
104+
"description": "Trufo image watermark (lite version).",
105+
"dateEntered": "2024-08-14T15:00:00.000Z",
106+
"contact": "[email protected]",
107+
"informationalUrl": "https://trufo.ai/publications/"
108+
}
109+
},
110+
{
111+
"identifier": 10,
112+
"alg": "app.overlai.watermark.1",
113+
"type": "watermark",
114+
"decodedMediaTypes": ["image"],
115+
"entryMetadata": {
116+
"description": "Overlai Watermark version 1",
117+
"dateEntered": "2024-08-14T16:00:00.000Z",
118+
"contact": "[email protected]",
119+
"informationalUrl": "https://overlai.app/watermark"
120+
}
121+
},
122+
{
123+
"identifier": 11,
124+
"alg": "tv.kinetiq.watercast.48.1",
125+
"type": "watermark",
126+
"decodedMediaTypes": ["video"],
127+
"entryMetadata": {
128+
"description": "Teletrax Watermarking algorithm",
129+
"dateEntered": "2024-10-16T17:00:00.000Z",
130+
"contact": "[email protected]",
131+
"informationalUrl": "https://kinetiq.tv/broadcasting-syndication/"
132+
}
133+
},
134+
{
135+
"identifier": 12,
136+
"alg": "castLabs.watermark.1",
137+
"type": "watermark",
138+
"decodedMediaTypes": ["video"],
139+
"entryMetadata": {
140+
"description": "castLabs Single Frame Forensic Watermarking",
141+
"dateEntered": "2024-11-13T12:00:00.000Z",
142+
"contact": "[email protected]",
143+
"informationalUrl": "https://castlabs.com/image-watermarking/"
144+
}
145+
},
146+
{
147+
"identifier": 13,
148+
"alg": "com.adobe.trustmark.P",
149+
"type": "watermark",
150+
"decodedMediaTypes": ["image"],
151+
"entryMetadata": {
152+
"description": "Adobe Trustmark variant P",
153+
"dateEntered": "2025-02-05T17:00:00.000Z",
154+
"contact": "[email protected]",
155+
"informationalUrl": "https://github.com/adobe/trustmark/"
156+
}
157+
}
158+
]

0 commit comments

Comments
 (0)