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
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # enable new "MSVC runtime library selection" (https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html)

project(libCZI
VERSION 0.66.5
VERSION 0.66.6
HOMEPAGE_URL "https://github.com/ZEISS/libczi"
DESCRIPTION "libCZI is an Open Source Cross-Platform C++ library to read and write CZI")

Expand Down Expand Up @@ -82,6 +82,16 @@ detect_win32_api_mode(
LIBCZI_HAVE_WIN32UWP_API
)

# Determine whether we are cross-compiling to Windows. When cross-compiling, there is insufficient support
# for the Windows Imaging Component (WIC), so we disable it.
if (LIBCZI_HAVE_WIN32_API)
if (CYGWIN OR MSYS OR MINGW)
set(LIBCZI_HAVE_WINCODECS_API OFF)
else()
set(LIBCZI_HAVE_WINCODECS_API ON)
endif()
endif()

# This option controls whether to build the curl-based http-/https-stream object. If this option is
# "ON", the build will fail if the curl-library is not available (either as an external package or
# as a private copy downloaded during the CMake-run).
Expand Down
2 changes: 1 addition & 1 deletion Src/CZICmd/BitmapGenGdiplus.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "IBitmapGen.h"

#if CZICMD_USE_GDIPLUS == 1
#include <Windows.h>
#include <windows.h>

class CBitmapGenGdiplus :public IBitmapGen
{
Expand Down
2 changes: 1 addition & 1 deletion Src/CZICmd/CZIcmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "inc_libCZI.h"
#include <clocale>
#if CZICMD_WINDOWSAPI_AVAILABLE
#include <Windows.h>
#include <windows.h>
#endif

class CLibCZISite : public libCZI::ISite
Expand Down
2 changes: 1 addition & 1 deletion Src/CZICmd/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <regex>

#if CZICMD_WINDOWSAPI_AVAILABLE
#include <Windows.h>
#include <windows.h>
#endif

#if defined(HAS_CODECVT)
Expand Down
2 changes: 1 addition & 1 deletion Src/JxrDecode/jxrlib/image/encode/strenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static _FORCEINLINE PixelI forwardHalf(PixelI hHalf)
// BitIOInfo init/term for encoding
//const size_t MAX_MEMORY_SIZE_IN_WORDS = 64 << 20; // 1 << 20 \approx 1 million

//#include <Windows.h>
//#include <windows.h>
//#define _WINDOWS_ 1

Int JXRLIB_API(StrIOEncInit)(CWMImageStrCodec* pSC)
Expand Down
10 changes: 8 additions & 2 deletions Src/libCZI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ if (LIBCZI_BUILD_DYNLIB)
target_compile_options(libCZI PRIVATE -D_FILE_OFFSET_BITS=64)
ENDIF(UNIX)
if(LIBCZI_HAVE_WIN32_API)
target_link_libraries(libCZI PRIVATE ole32 Windowscodecs)
target_link_libraries(libCZI PRIVATE ole32)
endif()
if(LIBCZI_HAVE_WINCODECS_API)
target_link_libraries(libCZI PRIVATE Windowscodecs)
endif()
target_include_directories(libCZI
PUBLIC
Expand Down Expand Up @@ -382,7 +385,10 @@ IF(UNIX)
set_property(TARGET libCZIStatic PROPERTY POSITION_INDEPENDENT_CODE ON)
ENDIF(UNIX)
if(LIBCZI_HAVE_WIN32_API)
target_link_libraries(libCZIStatic PUBLIC ole32 Windowscodecs)
target_link_libraries(libCZIStatic PUBLIC ole32)
endif()
if(LIBCZI_HAVE_WINCODECS_API)
target_link_libraries(libCZIStatic PUBLIC Windowscodecs)
endif()
target_compile_definitions(libCZIStatic PUBLIC _LIBCZISTATICLIB) # make sure that users of the static library get the correct definition

Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/StreamImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "inc_libCZI_Config.h"
#include <memory>
#if LIBCZI_WINDOWSAPI_AVAILABLE
#include <Windows.h>
#include <windows.h>
#endif

/// <summary> A simplistic output-stream implementation (based on C-runtime fopen). Note that this implementation is NOT thread-safe.</summary>
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/StreamsLib/windowsfileinputstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if LIBCZI_WINDOWSAPI_AVAILABLE
#include <string>
#include "../libCZI.h"
#include <Windows.h>
#include <windows.h>

/// Implementation of the IStream-interface for files based on the Win32-API.
/// It leverages the Win32-API ReadFile passing in an offset, thus allowing for concurrent
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/decoder_wic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "decoder_wic.h"

#if LIBCZI_WINDOWSAPI_AVAILABLE
#if LIBCZI_WINDOWSAPI_AVAILABLE && LIBCZI_HAVE_WINCODECS_API
#include "BitmapOperations.h"
#include <wincodec.h>
#include <sstream>
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/decoder_wic.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <libCZI_Config.h>

#if LIBCZI_WINDOWSAPI_AVAILABLE
#if LIBCZI_WINDOWSAPI_AVAILABLE && LIBCZI_HAVE_WINCODECS_API
Comment thread
Agapanthus marked this conversation as resolved.

@ptahmose ptahmose Aug 5, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this define would be propagated into the compilation. I'd don't see that the libCZI_Config.h.in mechanism is used - which would be the preferred way I guess. And I don't see it otherwise passed to the compiler (e.g. with target_compile_definitions).
Am I missing something here?


#include <memory>
#include "libCZI_Pixels.h"
Expand Down
2 changes: 2 additions & 0 deletions Src/libCZI/libCZI_Site.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class CSiteImpWic : public CSiteImpBase
{
switch (type)
{
#if LIBCZI_HAVE_WINCODECS_API
case ImageDecoderType::JPXR_JxrLib:
{
std::call_once(jxrDecoderInitialized,
Expand All @@ -69,6 +70,7 @@ class CSiteImpWic : public CSiteImpBase

return this->jpgXrdecoder;
}
#endif // LIBCZI_HAVE_WINCODECS_API
case ImageDecoderType::ZStd0:
{
std::call_once(zstd0DecoderInitialized,
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cstring>
#include <array>
#if LIBCZI_WINDOWSAPI_AVAILABLE || LIBCZI_WINDOWS_UWPAPI_AVAILABLE
#include <Windows.h>
#include <windows.h>
#else
#include <random>
#endif
Expand Down
3 changes: 2 additions & 1 deletion docs/source/pages/version_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ Version history
0.66.2 | [143](https://github.com/ZEISS/libczi/pull/143) | additional updates on CMake build system towards vcpkg support
0.66.3 | [144](https://github.com/ZEISS/libczi/pull/144) | add (initial and experimental) support for building for UWP (Universal Windows Platform)
0.66.4 | [145](https://github.com/ZEISS/libczi/pull/145) | have embedded pugixml in its own namespace, replace md5sum implementation, update 3rd-party license texts
0.66.5 | [146](https://github.com/ZEISS/libczi/pull/146) | have jxrlib-symbols mangled to prevent conflicts with other libraries
0.66.5 | [146](https://github.com/ZEISS/libczi/pull/146) | have jxrlib-symbols mangled to prevent conflicts with other libraries
0.66.6 | [139](https://github.com/ZEISS/libczi/pull/139) | add MinGW support
Loading