@enslo/sd-metadata 2.3.0 → 3.0.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/CHANGELOG.md +34 -0
- package/README.ja.md +53 -3
- package/README.md +55 -5
- package/dist/index.d.ts +58 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +3 -3
- package/dist/index.js +251 -21
- package/dist/index.js.map +1 -1
- package/docs/types.ja.md +80 -1
- package/docs/types.md +80 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.0] - 2026-06-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **C2PA Content Credentials detection** (#234): Detect AI provenance metadata
|
|
13
|
+
embedded by commercial tools (ChatGPT / OpenAI, Gemini / Google). When an
|
|
14
|
+
image carries no recognized generation parameters but has a signed C2PA
|
|
15
|
+
manifest, `read()` now returns a `c2pa` status with coarse vendor attribution
|
|
16
|
+
and the declared AI-generated flag.
|
|
17
|
+
- New `C2paMetadata` and `C2paVendor` types
|
|
18
|
+
- The manifest is read as declared; its cryptographic signature is **not**
|
|
19
|
+
verified, so presence is not proof of authenticity and absence is not proof
|
|
20
|
+
of human origin
|
|
21
|
+
|
|
22
|
+
### Potentially Breaking Changes
|
|
23
|
+
|
|
24
|
+
- **New `ParseResult` variant** (#234): `{ status: 'c2pa'; c2pa: C2paMetadata }`
|
|
25
|
+
added. TypeScript users with an exhaustive `switch` on `result.status` (or a
|
|
26
|
+
`Record<...>` keyed by the status union) will need to handle the new `'c2pa'`
|
|
27
|
+
case.
|
|
28
|
+
- **`read()` behavior change** (#234): images that carry a C2PA manifest but no
|
|
29
|
+
recognized generation metadata now return `{ status: 'c2pa' }` instead of
|
|
30
|
+
`{ status: 'unrecognized' }` or `{ status: 'empty' }`.
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
|
|
34
|
+
- **`read()` hardening** (#236): Fix two HIGH-severity issues when reading
|
|
35
|
+
malformed input — a ReDoS via unbounded regex backtracking in XMP parsing,
|
|
36
|
+
and an out-of-bounds `RangeError` while reading image dimensions.
|
|
37
|
+
|
|
38
|
+
### Maintenance
|
|
39
|
+
|
|
40
|
+
- Update development dependencies
|
|
41
|
+
|
|
8
42
|
## [2.3.0] - 2026-05-30
|
|
9
43
|
|
|
10
44
|
### Improved
|
package/README.ja.md
CHANGED
|
@@ -14,6 +14,7 @@ AI生成画像に埋め込まれたメタデータを読み書きするための
|
|
|
14
14
|
|
|
15
15
|
- **マルチフォーマット対応**: PNG (tEXt / iTXt)、JPEG (COM / Exif)、WebP (Exif)
|
|
16
16
|
- **シンプルAPI**: `read()`、`write()`、`embed()`、`stringify()` — 4つの関数で全ユースケースをカバー
|
|
17
|
+
- **AI生成元の検出**: C2PA Content Credentials を持つ画像(OpenAI ChatGPT、Google Gemini)を識別 — 検出のみ、署名検証なし
|
|
17
18
|
- **TypeScriptネイティブ**: TypeScriptで書かれており、型定義を完全同梱
|
|
18
19
|
- **ゼロ依存**: Node.jsとブラウザで外部依存なしで動作
|
|
19
20
|
- **フォーマット変換**: PNG、JPEG、WebP間でメタデータをシームレスに変換
|
|
@@ -148,7 +149,7 @@ fileInput.addEventListener('change', async (e) => {
|
|
|
148
149
|
// ==UserScript==
|
|
149
150
|
// @name My Script
|
|
150
151
|
// @namespace https://example.com
|
|
151
|
-
// @require https://cdn.jsdelivr.net/npm/@enslo/sd-metadata@
|
|
152
|
+
// @require https://cdn.jsdelivr.net/npm/@enslo/sd-metadata@3.0.0/dist/index.global.js
|
|
152
153
|
// ==/UserScript==
|
|
153
154
|
|
|
154
155
|
const response = await fetch(imageUrl);
|
|
@@ -211,6 +212,13 @@ switch (result.status) {
|
|
|
211
212
|
console.log(`Prompt: ${result.metadata.prompt}`);
|
|
212
213
|
break;
|
|
213
214
|
|
|
215
|
+
case 'c2pa':
|
|
216
|
+
// C2PA Content Credentials を検出(例:OpenAI ChatGPT、Google Gemini)。
|
|
217
|
+
// 検出のみ — 署名は検証されず、読み取れる生成パラメータ(プロンプト/シード/モデル)もありません。
|
|
218
|
+
console.log(`AI生成元(未検証): ${result.c2pa.vendor}`);
|
|
219
|
+
console.log(`Claim generator: ${result.c2pa.claimGenerator ?? 'unknown'}`);
|
|
220
|
+
break;
|
|
221
|
+
|
|
214
222
|
case 'unrecognized':
|
|
215
223
|
// メタデータは存在するがフォーマットが認識できない
|
|
216
224
|
console.log('不明なメタデータフォーマット');
|
|
@@ -258,6 +266,27 @@ if (result.ok) {
|
|
|
258
266
|
|
|
259
267
|
</details>
|
|
260
268
|
|
|
269
|
+
<details>
|
|
270
|
+
<summary>AI生成元の検出(C2PA Content Credentials)</summary>
|
|
271
|
+
|
|
272
|
+
一部の商用ツール(OpenAI ChatGPT、Google Gemini)は、生成パラメータの代わりに C2PA Content Credentials を埋め込みます。これらの画像に対して `read()` は `{ status: 'c2pa', c2pa }` を返します:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
import { read, c2paVendorLabels } from '@enslo/sd-metadata';
|
|
276
|
+
|
|
277
|
+
const result = read(imageData);
|
|
278
|
+
|
|
279
|
+
if (result.status === 'c2pa') {
|
|
280
|
+
console.log('Vendor:', c2paVendorLabels[result.c2pa.vendor]);
|
|
281
|
+
console.log('Declared AI-generated:', result.c2pa.aiGenerated);
|
|
282
|
+
console.log('Claim generator:', result.c2pa.claimGenerator ?? 'unknown');
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
> **検出のみ — 証明にはなりません。** C2PA署名を検証しないため、`c2pa` の結果は偽造可能で、真正性の証明にはなりません。また Content Credentials は再アップロードや再エンコードで失われやすいため、`c2pa` にならないことも「AI生成ではない」ことの証明にはなりません。
|
|
287
|
+
|
|
288
|
+
</details>
|
|
289
|
+
|
|
261
290
|
<details>
|
|
262
291
|
<summary>メタデータの削除</summary>
|
|
263
292
|
|
|
@@ -373,6 +402,8 @@ if (text) {
|
|
|
373
402
|
- `{ status: 'success', metadata, raw }` - パース成功
|
|
374
403
|
- `metadata`: 統一されたメタデータオブジェクト(`GenerationMetadata`を参照)
|
|
375
404
|
- `raw`: 元のフォーマット固有のデータ(chunks/segments)
|
|
405
|
+
- `{ status: 'c2pa', c2pa }` - 画像がC2PA Content Credentials(例:OpenAI ChatGPT、Google Gemini)を持つが、パース可能な生成メタデータがない
|
|
406
|
+
- `c2pa`: 未検証の Content Credentials(`C2paMetadata`を参照)。検出のみ — 署名は検証されません。
|
|
376
407
|
- `{ status: 'unrecognized', raw }` - 画像にメタデータがあるが既知のAIツールからではない
|
|
377
408
|
- `raw`: 変換用に保持された元のメタデータ
|
|
378
409
|
- `{ status: 'empty' }` - 画像にメタデータが見つからない
|
|
@@ -397,7 +428,7 @@ if (text) {
|
|
|
397
428
|
- `{ ok: false, error: { type, message? } }` - 失敗。`type` は以下のいずれか:
|
|
398
429
|
- `'unsupportedFormat'`: 対象画像がPNG、JPEG、WebP以外の場合
|
|
399
430
|
- `'conversionFailed'`: メタデータ変換に失敗(例:互換性のないフォーマット)
|
|
400
|
-
- `'writeFailed'`:
|
|
431
|
+
- `'writeFailed'`: 画像へのメタデータ埋め込みに失敗、または再書き込みが不可能な場合
|
|
401
432
|
|
|
402
433
|
### `embed(input: Uint8Array | ArrayBuffer, metadata: EmbedMetadata | GenerationMetadata): WriteResult`
|
|
403
434
|
|
|
@@ -431,7 +462,11 @@ SD WebUI (A1111) フォーマットでカスタムメタデータを画像に埋
|
|
|
431
462
|
|
|
432
463
|
**戻り値:**
|
|
433
464
|
|
|
434
|
-
- `ParseResult` の場合:
|
|
465
|
+
- `ParseResult` の場合:
|
|
466
|
+
- `success` → WebUIフォーマット
|
|
467
|
+
- `c2pa` → claim generator 名(`claimGenerator ?? ''`)
|
|
468
|
+
- `unrecognized` → 生テキスト
|
|
469
|
+
- `empty` / `invalid` → 空文字列
|
|
435
470
|
- `EmbedMetadata` / `GenerationMetadata` の場合: WebUIフォーマットのテキスト
|
|
436
471
|
|
|
437
472
|
**ユースケース:**
|
|
@@ -455,6 +490,20 @@ if (result.status === 'success') {
|
|
|
455
490
|
}
|
|
456
491
|
```
|
|
457
492
|
|
|
493
|
+
### `c2paVendorLabels: Record<C2paVendor, string>`
|
|
494
|
+
|
|
495
|
+
`C2paVendor` の識別子から表示用の名前への読み取り専用マッピング。
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
import { c2paVendorLabels } from '@enslo/sd-metadata';
|
|
499
|
+
|
|
500
|
+
const result = read(imageData);
|
|
501
|
+
if (result.status === 'c2pa') {
|
|
502
|
+
console.log(c2paVendorLabels[result.c2pa.vendor]);
|
|
503
|
+
// => "OpenAI (ChatGPT)", "Google (Gemini)", "AI-generated (Content Credentials)"
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
458
507
|
## 型リファレンス
|
|
459
508
|
|
|
460
509
|
このセクションでは主要な型の概要を説明します。完全な型定義については[型ドキュメント](./docs/types.ja.md)を参照してください。
|
|
@@ -466,6 +515,7 @@ if (result.status === 'success') {
|
|
|
466
515
|
```typescript
|
|
467
516
|
type ParseResult =
|
|
468
517
|
| { status: 'success'; metadata: GenerationMetadata; raw: RawMetadata }
|
|
518
|
+
| { status: 'c2pa'; c2pa: C2paMetadata }
|
|
469
519
|
| { status: 'unrecognized'; raw: RawMetadata }
|
|
470
520
|
| { status: 'empty' }
|
|
471
521
|
| { status: 'invalid'; message?: string };
|
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ A TypeScript library to read and write metadata embedded in AI-generated images.
|
|
|
14
14
|
|
|
15
15
|
- **Multi-format Support**: PNG (tEXt / iTXt), JPEG (COM / Exif), WebP (Exif)
|
|
16
16
|
- **Simple API**: `read()`, `write()`, `embed()`, `stringify()` — four functions cover all use cases
|
|
17
|
+
- **AI Provenance Detection**: identifies images carrying C2PA Content Credentials (OpenAI ChatGPT, Google Gemini) — detection only, no signature verification
|
|
17
18
|
- **TypeScript Native**: Written in TypeScript with full type definitions included
|
|
18
19
|
- **Zero Dependencies**: Works in Node.js and browsers without any external dependencies
|
|
19
20
|
- **Format Conversion**: Seamlessly convert metadata between PNG, JPEG, and WebP
|
|
@@ -148,7 +149,7 @@ For userscripts (Tampermonkey, Violentmonkey, etc.), load the IIFE build via `@r
|
|
|
148
149
|
// ==UserScript==
|
|
149
150
|
// @name My Script
|
|
150
151
|
// @namespace https://example.com
|
|
151
|
-
// @require https://cdn.jsdelivr.net/npm/@enslo/sd-metadata@
|
|
152
|
+
// @require https://cdn.jsdelivr.net/npm/@enslo/sd-metadata@3.0.0/dist/index.global.js
|
|
152
153
|
// ==/UserScript==
|
|
153
154
|
|
|
154
155
|
const response = await fetch(imageUrl);
|
|
@@ -211,6 +212,14 @@ switch (result.status) {
|
|
|
211
212
|
console.log(`Prompt: ${result.metadata.prompt}`);
|
|
212
213
|
break;
|
|
213
214
|
|
|
215
|
+
case 'c2pa':
|
|
216
|
+
// C2PA Content Credentials detected (e.g. OpenAI ChatGPT, Google Gemini).
|
|
217
|
+
// Detection only — the signature is NOT verified, and there are no
|
|
218
|
+
// generation parameters (prompt/seed/model) to read.
|
|
219
|
+
console.log(`AI provenance: ${result.c2pa.vendor} (unverified)`);
|
|
220
|
+
console.log(`Claim generator: ${result.c2pa.claimGenerator ?? 'unknown'}`);
|
|
221
|
+
break;
|
|
222
|
+
|
|
214
223
|
case 'unrecognized':
|
|
215
224
|
// Metadata exists but format is not recognized
|
|
216
225
|
console.log('Unknown metadata format');
|
|
@@ -258,6 +267,27 @@ if (result.ok) {
|
|
|
258
267
|
|
|
259
268
|
</details>
|
|
260
269
|
|
|
270
|
+
<details>
|
|
271
|
+
<summary>AI Provenance Detection (C2PA Content Credentials)</summary>
|
|
272
|
+
|
|
273
|
+
Some commercial tools (OpenAI ChatGPT, Google Gemini) embed a signed C2PA "Content Credentials" provenance manifest instead of generation parameters. `read()` returns `{ status: 'c2pa', c2pa }` for these images:
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
import { read, c2paVendorLabels } from '@enslo/sd-metadata';
|
|
277
|
+
|
|
278
|
+
const result = read(imageData);
|
|
279
|
+
|
|
280
|
+
if (result.status === 'c2pa') {
|
|
281
|
+
console.log('Vendor:', c2paVendorLabels[result.c2pa.vendor]);
|
|
282
|
+
console.log('Declared AI-generated:', result.c2pa.aiGenerated);
|
|
283
|
+
console.log('Claim generator:', result.c2pa.claimGenerator ?? 'unknown');
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
> **Detection only — not proof.** The C2PA signature is not verified, so a `c2pa` result is forgeable and cannot prove authenticity. Content Credentials are also easily stripped (screenshots, re-uploads, re-encoding), so the absence of a `c2pa` result does not prove an image is *not* AI-generated.
|
|
288
|
+
|
|
289
|
+
</details>
|
|
290
|
+
|
|
261
291
|
<details>
|
|
262
292
|
<summary>Removing Metadata</summary>
|
|
263
293
|
|
|
@@ -370,6 +400,8 @@ Reads and parses metadata from an image file.
|
|
|
370
400
|
- `{ status: 'success', metadata, raw }` - Successfully parsed
|
|
371
401
|
- `metadata`: Unified metadata object (see `GenerationMetadata`)
|
|
372
402
|
- `raw`: Original format-specific data (chunks/segments)
|
|
403
|
+
- `{ status: 'c2pa', c2pa }` - Image carries C2PA Content Credentials (e.g. OpenAI ChatGPT, Google Gemini) but no parseable generation metadata
|
|
404
|
+
- `c2pa`: Declared (unverified) AI provenance (see `C2paMetadata`). Detection only — the signature is not verified.
|
|
373
405
|
- `{ status: 'unrecognized', raw }` - Image has metadata but not from a known AI tool
|
|
374
406
|
- `raw`: Original metadata preserved for conversion
|
|
375
407
|
- `{ status: 'empty' }` - No metadata found in the image
|
|
@@ -394,7 +426,7 @@ Writes metadata to an image file.
|
|
|
394
426
|
- `{ ok: false, error: { type, message? } }` - Failed. `type` is one of:
|
|
395
427
|
- `'unsupportedFormat'`: Target image is not PNG, JPEG, or WebP
|
|
396
428
|
- `'conversionFailed'`: Metadata conversion failed (e.g., incompatible format)
|
|
397
|
-
- `'writeFailed'`: Failed to embed metadata into the image
|
|
429
|
+
- `'writeFailed'`: Failed to embed metadata into the image, or the input cannot be written back
|
|
398
430
|
|
|
399
431
|
### `embed(input: Uint8Array | ArrayBuffer, metadata: EmbedMetadata | GenerationMetadata): WriteResult`
|
|
400
432
|
|
|
@@ -430,9 +462,11 @@ Converts metadata to a human-readable string.
|
|
|
430
462
|
|
|
431
463
|
**Returns:**
|
|
432
464
|
|
|
433
|
-
- `ParseResult
|
|
434
|
-
- `
|
|
435
|
-
- `
|
|
465
|
+
- `ParseResult`:
|
|
466
|
+
- `success` → Human-readable text in WebUI format
|
|
467
|
+
- `c2pa` → The claim generator name (`claimGenerator ?? ''`)
|
|
468
|
+
- `unrecognized` → Raw metadata as plain text
|
|
469
|
+
- `empty` / `invalid` → Empty string
|
|
436
470
|
- `EmbedMetadata` / `GenerationMetadata` → Human-readable text in WebUI format
|
|
437
471
|
|
|
438
472
|
**Use cases:**
|
|
@@ -440,6 +474,7 @@ Converts metadata to a human-readable string.
|
|
|
440
474
|
- Displaying generation parameters in image viewers or galleries
|
|
441
475
|
- Copying metadata to clipboard as readable text
|
|
442
476
|
- Logging or debugging parsed metadata
|
|
477
|
+
- Previewing `EmbedMetadata` before embedding
|
|
443
478
|
|
|
444
479
|
### `softwareLabels: Record<GenerationSoftware, string>`
|
|
445
480
|
|
|
@@ -455,6 +490,20 @@ if (result.status === 'success') {
|
|
|
455
490
|
}
|
|
456
491
|
```
|
|
457
492
|
|
|
493
|
+
### `c2paVendorLabels: Record<C2paVendor, string>`
|
|
494
|
+
|
|
495
|
+
A read-only mapping from `C2paVendor` identifiers to their human-readable display names.
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
import { c2paVendorLabels } from '@enslo/sd-metadata';
|
|
499
|
+
|
|
500
|
+
const result = read(imageData);
|
|
501
|
+
if (result.status === 'c2pa') {
|
|
502
|
+
console.log(c2paVendorLabels[result.c2pa.vendor]);
|
|
503
|
+
// => "OpenAI (ChatGPT)", "Google (Gemini)", "AI-generated (Content Credentials)"
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
458
507
|
## Type Reference
|
|
459
508
|
|
|
460
509
|
This section provides an overview of the main types. For complete type definitions, see [Type Documentation](./docs/types.md).
|
|
@@ -466,6 +515,7 @@ The result of the `read()` function. It uses a discriminated union with a `statu
|
|
|
466
515
|
```typescript
|
|
467
516
|
type ParseResult =
|
|
468
517
|
| { status: 'success'; metadata: GenerationMetadata; raw: RawMetadata }
|
|
518
|
+
| { status: 'c2pa'; c2pa: C2paMetadata }
|
|
469
519
|
| { status: 'unrecognized'; raw: RawMetadata }
|
|
470
520
|
| { status: 'empty' }
|
|
471
521
|
| { status: 'invalid'; message?: string };
|
package/dist/index.d.ts
CHANGED
|
@@ -285,9 +285,46 @@ interface UpscaleSettings {
|
|
|
285
285
|
scale?: number;
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
288
|
+
* Vendor that signed an image's C2PA Content Credentials.
|
|
289
289
|
*
|
|
290
|
-
*
|
|
290
|
+
* Coarse by design: a C2PA manifest identifies the producing vendor but not the
|
|
291
|
+
* specific model (e.g. Imagen and Gemini "Nano Banana" both map to `google`).
|
|
292
|
+
*/
|
|
293
|
+
type C2paVendor = 'openai' | 'google' | 'unknown';
|
|
294
|
+
/**
|
|
295
|
+
* Content Credentials (C2PA) read from an image's signed manifest.
|
|
296
|
+
*
|
|
297
|
+
* Unlike {@link GenerationMetadata}, this carries no prompt/sampling/size data:
|
|
298
|
+
* commercial AI tools (ChatGPT, Gemini, ...) embed provenance, not generation
|
|
299
|
+
* parameters. The manifest is read as declared — the cryptographic signature is
|
|
300
|
+
* NOT verified, so presence is not proof of authenticity (the strings are
|
|
301
|
+
* forgeable). Likewise,
|
|
302
|
+
* absence is not proof of human origin: Content Credentials are routinely
|
|
303
|
+
* stripped by screenshots, re-encoding, and social-media re-uploads.
|
|
304
|
+
*/
|
|
305
|
+
interface C2paMetadata {
|
|
306
|
+
/**
|
|
307
|
+
* Coarse vendor attribution from the manifest's claim generator / signer.
|
|
308
|
+
* Declared, not cryptographically verified — never treat as proof of origin.
|
|
309
|
+
*/
|
|
310
|
+
vendor: C2paVendor;
|
|
311
|
+
/**
|
|
312
|
+
* `true` when the manifest declares a trained-algorithmic (AI-generated) IPTC
|
|
313
|
+
* DigitalSourceType. Camera/scan source types are not flagged. This is the
|
|
314
|
+
* image's *declared*, unverified status: a `false`/absent result is not proof
|
|
315
|
+
* of human origin, and a `true` result is forgeable.
|
|
316
|
+
*/
|
|
317
|
+
aiGenerated: boolean;
|
|
318
|
+
/** Raw IPTC DigitalSourceType URI, surfaced verbatim when present. */
|
|
319
|
+
digitalSourceType?: string;
|
|
320
|
+
/** C2PA `claim_generator_info.name`, when present. */
|
|
321
|
+
claimGenerator?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Parse result with 5-status design
|
|
325
|
+
*
|
|
326
|
+
* - `success`: Generation metadata parsed; metadata and raw data available
|
|
327
|
+
* - `c2pa`: C2PA Content Credentials found (AI provenance, no generation params)
|
|
291
328
|
* - `empty`: No metadata found in the file
|
|
292
329
|
* - `unrecognized`: Metadata exists but format is not recognized
|
|
293
330
|
* - `invalid`: File is corrupted or not a valid image
|
|
@@ -296,6 +333,9 @@ type ParseResult = {
|
|
|
296
333
|
status: 'success';
|
|
297
334
|
metadata: GenerationMetadata;
|
|
298
335
|
raw: RawMetadata;
|
|
336
|
+
} | {
|
|
337
|
+
status: 'c2pa';
|
|
338
|
+
c2pa: C2paMetadata;
|
|
299
339
|
} | {
|
|
300
340
|
status: 'empty';
|
|
301
341
|
} | {
|
|
@@ -499,6 +539,21 @@ declare function write(input: Uint8Array | ArrayBuffer, metadata: ParseResult):
|
|
|
499
539
|
* ```
|
|
500
540
|
*/
|
|
501
541
|
declare const softwareLabels: Readonly<Record<GenerationSoftware, string>>;
|
|
542
|
+
/**
|
|
543
|
+
* Human-readable display labels for each C2PA Content Credentials vendor.
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* ```typescript
|
|
547
|
+
* import { c2paVendorLabels } from '@enslo/sd-metadata';
|
|
548
|
+
*
|
|
549
|
+
* const result = read(imageData);
|
|
550
|
+
* if (result.status === 'c2pa') {
|
|
551
|
+
* console.log(c2paVendorLabels[result.c2pa.vendor]);
|
|
552
|
+
* // => "OpenAI (ChatGPT)", "Google (Gemini)", ...
|
|
553
|
+
* }
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
declare const c2paVendorLabels: Readonly<Record<C2paVendor, string>>;
|
|
502
557
|
//#endregion
|
|
503
|
-
export { type BaseMetadata, type CharacterPrompt, type ComfyNode, type ComfyNodeGraph, type ComfyNodeInputValue, type ComfyNodeReference, type EmbedMetadata, type GenerationMetadata, type GenerationSoftware, type HiresSettings, type ITXtChunk, type MetadataSegment, type MetadataSegmentSource, type ModelSettings, type ParseResult, type PngTextChunk, type RawMetadata, type ReadOptions, type SamplingSettings, type TExtChunk, type UpscaleSettings, type WriteResult, type WriteWarning, embed, embed as writeAsWebUI, buildEmbedText as formatAsWebUI, formatRaw, read, softwareLabels, stringify, write };
|
|
558
|
+
export { type BaseMetadata, type C2paMetadata, type C2paVendor, type CharacterPrompt, type ComfyNode, type ComfyNodeGraph, type ComfyNodeInputValue, type ComfyNodeReference, type EmbedMetadata, type GenerationMetadata, type GenerationSoftware, type HiresSettings, type ITXtChunk, type MetadataSegment, type MetadataSegmentSource, type ModelSettings, type ParseResult, type PngTextChunk, type RawMetadata, type ReadOptions, type SamplingSettings, type TExtChunk, type UpscaleSettings, type WriteResult, type WriteWarning, c2paVendorLabels, embed, embed as writeAsWebUI, buildEmbedText as formatAsWebUI, formatRaw, read, softwareLabels, stringify, write };
|
|
504
559
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/api/embed.ts","../src/api/read.ts","../src/api/stringify.ts","../src/api/write.ts","../src/constants.ts"],"mappings":";;;;KAoBY,YAAA,GAAe,SAAA,GAAY,SAAS;;;;UAK/B,SAAA;EACf,IAAA;EAuBI;EArBJ,OAAA;EAgCU;EA9BV,IAAA;AAAA;;;;UAMe,SAAA;EACf,IAAA;EA0BsB;EAxBtB,OAAA;EA0BI;EAxBJ,eAAA;EAwBQ;EAtBR,iBAAA;EA2B8B;EAzB9B,WAAA;EA2B6B;EAzB7B,iBAAA;EAyBQ;EAvBR,IAAA;AAAA;AAyBI;AAMN;;;AANM,KAdM,qBAAA;EACN,IAAA;AAAA;EACA,IAAA;EAA8B,MAAA;AAAA;EAC9B,IAAA;EAAkB,MAAA;AAAA;EAClB,IAAA;AAAA;EACA,IAAA;AAAA;;;AAkByC;UAb9B,eAAA;EAsBa;EApB5B,MAAA,EAAQ,qBAAqB;EAoBD;EAlB5B,IAAA;AAAA;;;;KAMU,WAAA;EACN,MAAA;EAAe,MAAA,EAAQ,YAAA;AAAA;EACvB,MAAA;EAAgB,QAAA,EAAU,eAAA;AAAA;EAC1B,MAAA;EAAgB,QAAA,EAAU,eAAA;AAAA;;;;KASpB,kBAAA;;;;UA4BK,YAAA;EAgBT;EAdN,MAAA;EAoB+B;EAlB/B,cAAA;EAkBmD;EAhBnD,KAAA,GAAQ,aAAA;EAiBR;EAfA,QAAA,GAAW,gBAAA;EAiBQ;EAfnB,KAAA,GAAQ,aAAA;EAmBR;EAjBA,OAAA,GAAU,eAAA;EAiBF;EAfR,KAAA;EAqB8B;EAnB9B,MAAA;AAAA;;;;UAMe,eAAA,SAAwB,YAAY;EACnD,QAAA;EAgBuB;EAdvB,gBAAA,GAAmB,eAAA;EA6BS;EA3B5B,SAAA;EA2BgC;EAzBhC,QAAA;AAAA;;;;UAMe,eAAA;EAkCA;EAhCf,MAAA;;EAEA,MAAA;IAAW,CAAA;IAAW,CAAA;EAAA;AAAA;;;;;AAyCZ;AAQZ;;;;AAAqD;AAOrD;AAPA,KAlCY,kBAAA,IAAsB,MAAA,UAAgB,WAAW;;;;KAKjD,mBAAA,+BAIR,kBAAA,GACA,mBAAmB;;;;UAKN,SAAA;EA0CA;EAxCf,UAAA;;EAEA,MAAA,EAAQ,MAAM,SAAS,mBAAA;EAsCgB;EApCvC,KAAA;IA4CA,6BA1CE,KAAA;EAAA;EA0CoB;EAvCtB,UAAA;AAAA;;;AAiDkE;AASpE;;KAlDY,cAAA,GAAiB,MAAM,SAAS,SAAA;;AAmDlC;AAiCV;;;UA7EiB,oBAAA,SAA6B,YAAY;EACxD,QAAA;EA+EE;;;;;;EAxEF,KAAA,EAAO,cAAA;AAAA;AAkFT;;;;;AAAA,UA1EiB,eAAA,SAAwB,YAAY;EACnD,QAAA;EA4EiB;;;;;;EArEjB,KAAA,GAAQ,cAAA;AAAA;AAqES;AAUnB;;;;;;AAVmB,KA3DP,eAAA,GAAkB,oBAAA,GAAuB,eAAe;;AA2E/D;AAML;;;;;UAxEiB,gBAAA,SAAyB,YAAY;EACpD,QAAQ;AAAA;;;;;AAqFD;AAMT;;;;;;;;;AAQS;AAMT;KAxEY,kBAAA,GACR,eAAA,GACA,eAAA,GACA,gBAAA;;;AAyEG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/api/embed.ts","../src/api/read.ts","../src/api/stringify.ts","../src/api/write.ts","../src/constants.ts"],"mappings":";;;;KAoBY,YAAA,GAAe,SAAA,GAAY,SAAS;;;;UAK/B,SAAA;EACf,IAAA;EAuBI;EArBJ,OAAA;EAgCU;EA9BV,IAAA;AAAA;;;;UAMe,SAAA;EACf,IAAA;EA0BsB;EAxBtB,OAAA;EA0BI;EAxBJ,eAAA;EAwBQ;EAtBR,iBAA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