Skip to content

Releases: TrustNXT/c2pa-ts

v0.13.3

10 Mar 16:53
5686201

Choose a tag to compare

Patch Changes

  • d66aba5: Add createAsset helper method

v0.13.2

02 Feb 16:08
71a76f0

Choose a tag to compare

Patch Changes

  • 362c715: Fixed MP3 detection to handle raw MP3 files without ID3 tags

    The MP3 asset detection now properly handles MP3 files that start with audio frame data instead of an ID3 tag header. This fixes the "unsupported image format" error when protecting MP3 files generated by encoders like lamejs that produce raw audio frames.

    Changes:

    • Added proper 11-bit sync word detection (0xFF + (byte1 & 0xE0) === 0xE0) for MP3 frame headers

v0.13.1

13 Jan 13:54
a2f6bf1

Choose a tag to compare

Patch Changes

  • c3d5993: Use proper DER encoding for CMS SignedAttributes

v0.13.0

12 Jan 00:20
49df9af

Choose a tag to compare

Minor Changes

  • 1e7491c: Runtime Agnostic Streaming - Breaking API Change

    Changed APIs

    • writeToFile(path: string)writeToStream(stream: WritableStream<Uint8Array>)

      This change affects:

    • AssetDataReader.writeToFileAssetDataReader.writeToStream

    • Asset.writeToFileAsset.writeToStream

    • BaseAsset.writeToFileBaseAsset.writeToStream

    • BlobDataReader.writeToFileBlobDataReader.writeToStream

    • BufferDataReader.writeToFileBufferDataReader.writeToStream

      Migration Guide

      The caller is now responsible for creating the WritableStream using their runtime:

      Node.js:

      import { createWriteStream } from 'node:fs';
      import { Writable } from 'node:stream';
      
      const nodeStream = createWriteStream(outputPath);
      const writableStream = Writable.toWeb(nodeStream);
      await asset.writeToStream(writableStream);

      Removed Node.js Imports

    • Removed import { createWriteStream, WriteStream } from 'node:fs' from BlobDataReader.ts

    • Removed import { writeFile } from 'node:fs/promises' from BufferDataReader.ts

      This enables the library to be bundled for client-side applications (e.g., Next.js with Turbopack) without Node.js polyfills.

v0.12.1

09 Jan 14:53
df5493e

Choose a tag to compare

Patch Changes

  • 0831623: ### Browser Compatibility Fix

    Fixed a bundler error that occurred when using c2pa-ts in browser environments (e.g., Next.js with Turbopack).

    Problem:
    Top-level imports of Node.js fs and fs/promises modules in BlobDataReader and BufferDataReader caused build failures in browser bundlers, even though the writeToFile() method is only intended for Node.js usage.

    Solution:
    Converted static top-level imports to dynamic imports inside writeToFile() methods. This ensures the fs modules are only loaded when writeToFile() is actually called at runtime, allowing the library to be bundled for browser environments without errors.

    Note: The writeToFile() method remains Node.js-only and will fail if called in a browser environment.

v0.12.0

06 Jan 18:53
66f0bf0

Choose a tag to compare

Minor Changes

  • 1deb78f: Add MP4 video file support
    • Added support for MP4 video files (mp41, mp42, isom brands)
    • Implemented StcoBox and Co64Box classes for proper chunk offset patching when inserting C2PA manifests in MP4 files
    • Fixed QuickTime-style MetaBox parsing to handle both ISO BMFF and QuickTime formats
    • Fixed JUMBF extraction to exclude trailing padding bytes
    • Made metadata assertion JSON-LD parser more lenient with undefined prefixes
    • Added MP4 video signing and validation tests
    • MP4 files can now be signed and validated using BMFF v2 and v3 hash assertions

Patch Changes

  • 6f65a61: Increase interoperability when using LocalTimestampProvider

v0.11.0

05 Jan 16:32

Choose a tag to compare

Minor Changes

  • b3c0102: # Large Asset Support - Asset Abstraction

    ⚠️ Breaking API Changes — Several methods are now async. Add await where needed.

    What's New

    • Blob support: Assets accept Uint8Array or Blob — enables streaming large files (multi-GB) without loading into memory

    • writeToFile(path): Streams output directly to disk (preferred for large files)

    • getBlob(): Returns underlying Blob if available

      Breaking Changes

      Asset Creation & Interface

      The AssetType interface has been updated to support async creation and Blob sources. Use create() instead of new.

      // Before
      const asset = new JPEG(data);
      const canRead = JPEG.canRead(data);
      
      // After
      const asset = await JPEG.create(data);
      const canRead = await JPEG.canRead(data);

      Async Methods

      These methods are now async:

      Method Now returns
      canRead() Promise<boolean>
      create() Promise<Asset>
      getManifestJUMBF() Promise<Uint8Array | undefined>
      ensureManifestSpace() Promise<void>
      writeManifestJUMBF() Promise<void>

v0.10.0

19 Dec 16:03

Choose a tag to compare

Minor Changes

  • 1e8b6e0: Write ECDSA signatures in P1363 format

v0.9.5

12 Dec 15:03
d628c35

Choose a tag to compare

Patch Changes

  • 68b9c64: Fix TypeScript 5.8+ ArrayBuffer/BufferSource compatibility inconsistencies

v0.9.4

12 Nov 10:59
8cb790f

Choose a tag to compare

Patch Changes