From dd71d111795a68a8b8ba5170f6e1108e6ca008f1 Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:24:25 -0700 Subject: [PATCH 1/6] chore: Bumpt c2pa-rs to 0.79.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e03ede2..fb0f9f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.27) project(c2pa-c VERSION 0.23.0) # Set the version of the c2pa_rs library used -set(C2PA_VERSION "0.79.3") +set(C2PA_VERSION "0.79.4") set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) set(CMAKE_C_STANDARD 17) From 7f1d59b1c93c6dcbba5edd906d3a1edaf24cc9e2 Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:05:48 -0700 Subject: [PATCH 2/6] fix: Simplify --- .claude/settings.json | 10 ++++++++++ CMakeLists.txt | 2 +- src/c2pa_builder.cpp | 17 ++++++++++++++--- tests/CMakeLists.txt | 3 +++ 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..74a3334 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,10 @@ +{ + "permissions": { + "allow": [ + "Bash(cmake --build build/debug --target c2pa_cpp)", + "Bash(make test-san:*)", + "Bash(git checkout:*)", + "Bash(build/debug/tests/c2pa_c_tests --gtest_filter='BuilderTest.SignWithTwoPngIngredientArchives*')" + ] + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt index fb0f9f5..e727121 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.27) # This is the current version of this C++ project -project(c2pa-c VERSION 0.23.0) +project(c2pa-c VERSION 0.23.1) # Set the version of the c2pa_rs library used set(C2PA_VERSION "0.79.4") diff --git a/src/c2pa_builder.cpp b/src/c2pa_builder.cpp index 8b1249a..686dd8a 100644 --- a/src/c2pa_builder.cpp +++ b/src/c2pa_builder.cpp @@ -104,9 +104,20 @@ namespace c2pa : builder(nullptr) { CppIStream c_archive(archive); - builder = c2pa_builder_from_archive(c_archive.c_stream); - if (builder == nullptr) - { + + C2paContext* ctx = c2pa_context_new(); + if (ctx == nullptr) { + throw C2paException(); + } + + C2paBuilder* base = c2pa_builder_from_context(ctx); + c2pa_free(ctx); + if (base == nullptr) { + throw C2paException(); + } + + builder = c2pa_builder_with_archive(base, c_archive.c_stream); + if (builder == nullptr) { throw C2paException(); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8fc031d..69b8815 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -183,6 +183,9 @@ else() # On Unix systems, link directly to the shared library target_link_libraries(ctest PRIVATE "${C2PA_C_LIB}") endif() +if(NOT MSVC) + target_compile_options(ctest PRIVATE -Wno-deprecated-declarations) +endif() target_include_directories(ctest PRIVATE "${C2PA_PREBUILT_INCLUDE_DIR}" ${CMAKE_CURRENT_SOURCE_DIR}/c-app-test From a7f2a4c57f7ada9cdf11f1b12dd17cb3451ec425 Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:06:25 -0700 Subject: [PATCH 3/6] fix: Clean up --- .claude/settings.json | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json deleted file mode 100644 index 74a3334..0000000 --- a/.claude/settings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(cmake --build build/debug --target c2pa_cpp)", - "Bash(make test-san:*)", - "Bash(git checkout:*)", - "Bash(build/debug/tests/c2pa_c_tests --gtest_filter='BuilderTest.SignWithTwoPngIngredientArchives*')" - ] - } -} From 5b3df8b6e0347141497f0c72e0b07a753469e247 Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:08:50 -0700 Subject: [PATCH 4/6] fix: Simplify --- .claude/settings.json | 3 ++- src/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 74a3334..0ea0d2d 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -4,7 +4,8 @@ "Bash(cmake --build build/debug --target c2pa_cpp)", "Bash(make test-san:*)", "Bash(git checkout:*)", - "Bash(build/debug/tests/c2pa_c_tests --gtest_filter='BuilderTest.SignWithTwoPngIngredientArchives*')" + "Bash(build/debug/tests/c2pa_c_tests --gtest_filter='BuilderTest.SignWithTwoPngIngredientArchives*')", + "Bash(ctest --test-dir build/debug -R c_test --output-on-failure)" ] } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67c856a..54da8a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,7 +239,8 @@ if(MSVC) /sdl /guard:cf /GS - /DYNAMICBASE) + /DYNAMICBASE + /wd4996) target_link_options(c2pa_cpp PRIVATE /DYNAMICBASE @@ -254,6 +255,7 @@ else() -Wstack-protector -fstack-protector-strong -fPIC + -Wno-deprecated-declarations ) if(APPLE) From 3dab6cfda1d00a45c8f04f6c52cdafd97c905d87 Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Wed, 15 Apr 2026 12:47:56 -0700 Subject: [PATCH 5/6] Delete .claude/settings.json --- .claude/settings.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json deleted file mode 100644 index 0ea0d2d..0000000 --- a/.claude/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(cmake --build build/debug --target c2pa_cpp)", - "Bash(make test-san:*)", - "Bash(git checkout:*)", - "Bash(build/debug/tests/c2pa_c_tests --gtest_filter='BuilderTest.SignWithTwoPngIngredientArchives*')", - "Bash(ctest --test-dir build/debug -R c_test --output-on-failure)" - ] - } -} From 9554024ac911d7948fa257813b82762152bbdd8e Mon Sep 17 00:00:00 2001 From: tmathern <60901087+tmathern@users.noreply.github.com> Date: Wed, 15 Apr 2026 12:48:23 -0700 Subject: [PATCH 6/6] Update C2PA version to 0.79.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e727121..e20362b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.27) project(c2pa-c VERSION 0.23.1) # Set the version of the c2pa_rs library used -set(C2PA_VERSION "0.79.4") +set(C2PA_VERSION "0.79.5") set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) set(CMAKE_C_STANDARD 17)