Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
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.3")
set(C2PA_VERSION "0.79.5")

set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
set(CMAKE_C_STANDARD 17)
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ if(MSVC)
/sdl
/guard:cf
/GS
/DYNAMICBASE)
/DYNAMICBASE
/wd4996)

target_link_options(c2pa_cpp PRIVATE
/DYNAMICBASE
Expand All @@ -254,6 +255,7 @@ else()
-Wstack-protector
-fstack-protector-strong
-fPIC
-Wno-deprecated-declarations
)

if(APPLE)
Expand Down
17 changes: 14 additions & 3 deletions src/c2pa_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading