Skip to content

Commit b76dddf

Browse files
committed
commit for CI debugging, will be removed later
Signed-off-by: loicvital <[email protected]>
1 parent 2a5fc74 commit b76dddf

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

src/cmake/build_libuhdr.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ build_dependency_with_cmake(libuhdr
2222
-D CMAKE_INSTALL_LIBDIR=lib
2323
-D CMAKE_POSITION_INDEPENDENT_CODE=ON
2424
-D UHDR_BUILD_EXAMPLES=FALSE
25+
-D UHDR_BUILD_DEPS=FALSE
2526
-D UHDR_ENABLE_LOGS=TRUE
27+
-D JPEG_ROOT=${libjpeg-turbo_ROOT}
2628
)
2729

2830
if (WIN32)

src/cmake/modules/Findlibuhdr.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ find_package_handle_standard_args (libuhdr
2828
REQUIRED_VARS LIBUHDR_INCLUDE_DIR
2929
LIBUHDR_LIBRARY
3030
)
31+
32+
if (libuhdr_FOUND)
33+
message("libuhdr: includedir=${LIBUHDR_INCLUDE_DIR} library=${LIBUHDR_LIBRARY}")
34+
endif()

src/jpeg.imageio/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44

55
if (libuhdr_FOUND)
66
set (UHDR_DEFS USE_UHDR)
7+
else ()
8+
set (LIBUHDR_INCLUDE_DIR "")
9+
set (LIBUHDR_LIBRARY "")
10+
set (UHDR_DEFS "")
711
endif ()
812

13+
message("UHDR_DEFS: ${UHDR_DEFS}")
14+
915
add_oiio_plugin (jpeginput.cpp jpegoutput.cpp
1016
INCLUDE_DIRS ${LIBUHDR_INCLUDE_DIR}
1117
LINK_LIBRARIES
1218
$<TARGET_NAME_IF_EXISTS:libjpeg-turbo::jpeg>
1319
$<TARGET_NAME_IF_EXISTS:JPEG::JPEG>
1420
${LIBUHDR_LIBRARY}
15-
DEFINITIONS ${UHDR_DEFS}
21+
DEFINITIONS "${UHDR_DEFS}"
1622
)

src/jpeg.imageio/jpeginput.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ JpgInput::open(const std::string& name, ImageSpec& newspec)
337337
if (m_spec.find_attribute("hdrgm:Version"))
338338
m_is_uhdr = read_uhdr(m_io);
339339

340+
std::cout << "INVESTIGATE: m_is_uhdr=" << m_is_uhdr << std::endl;
341+
340342
newspec = m_spec;
341343
return true;
342344
}
@@ -418,15 +420,21 @@ bool
418420
JpgInput::read_uhdr(Filesystem::IOProxy* ioproxy)
419421
{
420422
#if defined(USE_UHDR)
423+
std::cout << "INVESTIGATE: read_uhdr main content" << std::endl;
421424
// Read entire file content into buffer.
422425
const size_t buffer_size = ioproxy->size();
423426
std::vector<unsigned char> buffer(buffer_size);
424427
ioproxy->pread(buffer.data(), buffer_size, 0);
425428

429+
std::cout << "INVESTIGATE: proxytype=" << ioproxy->proxytype() << std::endl;
430+
std::cout << "INVESTIGATE: proxytype=" << buffer_size << std::endl;
431+
std::cout << "INVESTIGATE: " << jpeg_imageio_library_version() << std::endl;
432+
426433
// Check if this is an actual Ultra HDR image.
427434
const bool detect_uhdr = is_uhdr_image(buffer.data(), buffer.size());
428-
if (!detect_uhdr)
429-
return false;
435+
std::cout << "INVESTIGATE: detect_uhdr=" << detect_uhdr << std::endl;
436+
//if (!detect_uhdr)
437+
// return false;
430438

431439
// Create Ultra HDR decoder.
432440
// Do not forget to release it once we don't need it,
@@ -446,12 +454,14 @@ JpgInput::read_uhdr(Filesystem::IOProxy* ioproxy)
446454
// Decode Ultra HDR image
447455
// and check for decoding errors.
448456
uhdr_error_info_t err_info = uhdr_decode(m_uhdr_dec);
457+
std::cout << "INVESTIGATE: error_code=" << err_info.error_code << std::endl;
449458

450459
if (err_info.error_code != UHDR_CODEC_OK) {
451460
errorfmt("Ultra HDR decoding failed with error code {}",
452461
int(err_info.error_code));
453462
if (err_info.has_detail != 0)
454-
errorfmt("Additional error details: {}", err_info.detail);
463+
std::cout << "INVESTIGATE: error details = " << err_info.detail << std::endl;
464+
//errorfmt("Additional error details: {}", err_info.detail);
455465
uhdr_release_decoder(m_uhdr_dec);
456466
return false;
457467
}
@@ -488,6 +498,7 @@ JpgInput::read_uhdr(Filesystem::IOProxy* ioproxy)
488498

489499
return true;
490500
#else
501+
std::cout << "INVESTIGATE: read_uhdr placeholder" << std::endl;
491502
return false;
492503
#endif
493504
}

0 commit comments

Comments
 (0)