Skip to content

feat: adds --progress option to c2patool and optimizes the asset signing workflow.#1937

Closed
gpeacock wants to merge 14 commits intomainfrom
gpeacock/progress_cancel_cli
Closed

feat: adds --progress option to c2patool and optimizes the asset signing workflow.#1937
gpeacock wants to merge 14 commits intomainfrom
gpeacock/progress_cancel_cli

Conversation

@gpeacock
Copy link
Copy Markdown
Member

No description provided.

gpeacock added 9 commits March 6, 2026 21:37
Progress API: Replace OperationPhase with ProgressPhase (#[repr(u8)]), and ProgressCallback trait with ProgressCallbackFunc (Fn(ProgressPhase, f32) -> bool). Progress is reported as f32 0.0–1.0 instead of u8 0–100.
Cancellation: Add cancel() and is_cancelled() on Context; remove Arc<AtomicBool> cancellation token. Add Error::OperationCancelled.
C FFI: Add c2pa_context_builder_set_progress_callback(builder, user_data, callback) and c2pa_context_cancel(ctx). Remove C2paCancellationToken and related APIs.
Coverage: Add check_progress in builder (save_to_stream), store, and claim so callbacks run during signing, embedding, and verification.
Tests: Add unit tests for progress/cancel in context.rs and integration tests in builder.rs.
Docs: Add docs/pro
Replaced f32 pct with (u32 step, u32 total) in the callback type
Renamed/replaced phases: Ingredients/Verification/RemoteFetch → Reading, VerifyingManifest, VerifyingSignature, VerifyingIngredient, VerifyingAssetHash, FetchingRemoteManifest (keeping Thumbnail, Hashing, Signing, Embedding)
added builder_sample.rs — Updated to demonstrate the new API with per-phase elapsed timing output and assertions against the new phase names
Added more instrumentation for phases.
Also updates c2patool to use Context/Settings
also updates to use Context
Some optimizations for large riff and tiff files
Avoids copies when no remote url and not removing manifests
context/settings work in c2patool
fix: vlc Riff files with DWORD alignement supported
@gpeacock gpeacock marked this pull request as draft March 16, 2026 17:53
Base automatically changed from gpeacock/progress_cancel to main March 24, 2026 20:18
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 24, 2026

Merging this PR will improve performance by ×3.6

⚡ 14 improved benchmarks
✅ 18 untouched benchmarks
⏩ 2 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory sign 100kb svg 480.7 KB 352.7 KB +36.29%
Memory sign 100kb mp3 516.7 KB 388.7 KB +32.93%
Memory sign 100kb wav 581.6 KB 299.7 KB +94.08%
Memory sign 100kb jpeg 517.9 KB 365.2 KB +41.79%
Memory read 100kb-signed.wav (with manifest) 274.1 KB 164.4 KB +66.67%
Memory sign 100kb gif 470.5 KB 342.8 KB +37.25%
Memory sign 100kb png 518.2 KB 365.6 KB +41.75%
Memory sign 100kb tiff 238.7 KB 110.7 KB ×2.2
Memory sign 100kb mp4 464.1 KB 129.3 KB ×3.6
Simulation sign 100kb jpeg 4.8 ms 4.4 ms +10.35%
Simulation sign 100kb mp4 5.5 ms 4.3 ms +26.44%
Simulation sign 100kb png 5.6 ms 5.1 ms +10.52%
Simulation sign 100kb wav 4.6 ms 3.7 ms +23.48%
Simulation sign 100kb tiff 1.7 ms 1.4 ms +19.88%

Comparing gpeacock/progress_cancel_cli (225cef4) with main (bbd3057)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 84.02367% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.04%. Comparing base (bbd3057) to head (225cef4).

Files with missing lines Patch % Lines
sdk/src/store.rs 80.12% 31 Missing ⚠️
sdk/src/asset_handlers/png_io.rs 68.57% 11 Missing ⚠️
sdk/src/asset_handlers/riff_io.rs 92.99% 11 Missing ⚠️
sdk/src/asset_handlers/tiff_io.rs 76.59% 11 Missing ⚠️
sdk/src/asset_handlers/jpeg_io.rs 88.88% 8 Missing ⚠️
sdk/src/asset_io.rs 30.00% 7 Missing ⚠️
sdk/src/jumbf_io.rs 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1937      +/-   ##
==========================================
+ Coverage   76.89%   77.04%   +0.15%     
==========================================
  Files         175      175              
  Lines       42438    42828     +390     
==========================================
+ Hits        32631    32998     +367     
- Misses       9807     9830      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpeacock gpeacock closed this Mar 24, 2026
@gpeacock gpeacock deleted the gpeacock/progress_cancel_cli branch March 24, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant