Skip to content
Closed
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
99 changes: 51 additions & 48 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,88 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms

on:
push:
branches: [ "master"]
branches: [ "master" ]
pull_request:
branches: [ "master"]
branches: [ "master" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: true

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [windows-latest, ubuntu-latest]
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
c_compiler: [gcc, clang, cl, x86_64-w64-mingw32-gcc]

include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
exe_suffix: .exe
mingw: false

- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
exe_suffix: ""
mingw: false

- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exe_suffix: ""
mingw: false

- os: ubuntu-latest
c_compiler: x86_64-w64-mingw32-gcc
cpp_compiler: x86_64-w64-mingw32-g++
exe_suffix: .exe
mingw: true

exclude:
- os: windows-latest
- os: windows-2025-vs2026
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: windows-latest
c_compiler: x86_64-w64-mingw32-gcc
- os: ubuntu-latest
c_compiler: cl

steps:
- uses: actions/checkout@v3

- name: Git update submodules
run: |
git submodule update --init --recursive --depth 1
- uses: actions/checkout@v3

- name: Install MinGW (only if mingw is true)
if: matrix.mingw == true
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Update submodules
run: git submodule update --init --recursive --depth 1

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Set build directory
id: vars
run: echo "dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Configure CMake
run: >
cmake -S . -B ${{ github.workspace }}/build
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
${{ matrix.mingw && '-DCMAKE_TOOLCHAIN_FILE=mingw-w64-x86_64.cmake' || '' }}

- name: Test windows
working-directory: ${{ steps.strings.outputs.build-output-dir }}/Example/Release
if: matrix.os == 'windows-latest'
run: |
./ImageLoaderExample.exe
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}

- name: Test Ubuntu
working-directory: ${{ steps.strings.outputs.build-output-dir }}/Example
if: matrix.os == 'ubuntu-latest'
run: |
./ImageLoaderExample
- name: Run tests
if: matrix.mingw == false
working-directory: >-
${{ github.workspace }}/build/Example${{
matrix.os == 'windows-latest' && format('/{0}', matrix.build_type) || ''
}}
run: ./ImageLoaderExample${{ matrix.exe_suffix }}
11 changes: 7 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
url = https://github.com/TheNicker/libpsd.git
[submodule "External/libpng"]
path = External/libpng
url = https://github.com/OpenImageViewer/libpng.git
url = https://github.com/lib-apng/libapng.git
[submodule "External/zlib"]
path = External/zlib
url = https://github.com/OpenImageViewer/zlib.git
url = https://github.com/madler/zlib.git
[submodule "External/libgif"]
path = External/libgif
url = https://github.com/OpenImageViewer/libgif.git
[submodule "External/libtiff"]
path = External/libtiff
url = https://github.com/OpenImageViewer/libtiff.git
url = https://gitlab.com/libtiff/libtiff.git
[submodule "External/libjpeg-turbo"]
path = External/libjpeg-turbo
url = https://github.com/OpenImageViewer/libjpeg-turbo.git
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
[submodule "External/bintools"]
path = External/bintools
url = https://github.com/OpenImageViewer/bintools.git
Expand All @@ -34,3 +34,6 @@
[submodule "External/ExoticNumbers"]
path = External/ExoticNumbers
url = https://github.com/OpenImageViewer/ExoticNumbers.git
[submodule "External/FreeImageRe"]
path = External/FreeImageRe
url = https://github.com/agruzdev/FreeImageRe.git
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.8)
cmake_minimum_required (VERSION 3.10)
project(ImageCodec)

#Image Codec
Expand Down Expand Up @@ -31,7 +31,7 @@ option(IMCODEC_BUILD_CODEC_GIF "Build Codec GIF" TRUE)
option(IMCODEC_BUILD_CODEC_ICON "Build Codec Icon" TRUE)
option(IMCODEC_BUILD_CODEC_TIFF "Build Codec TIFF" TRUE)
option(IMCODEC_BUILD_CODEC_WEBP "Build Codec WEBP" TRUE)
option(IMCODEC_BUILD_CODEC_FREEIMAGE "Build Codec FREEIMAGE" FALSE)
option(IMCODEC_BUILD_CODEC_FREEIMAGE "Build Codec FREEIMAGE" TRUE)

option(IMCODEC_BUILD_EXAMPLES "Build Examples" TRUE)

Expand Down Expand Up @@ -92,4 +92,4 @@ endif()

if (IMCODEC_BUILD_EXAMPLES AND IMCODEC_BUILD_CODEC_JPG AND IMCODEC_BUILD_CODEC_PNG)
add_subdirectory(Example)
endif()
endif()
2 changes: 1 addition & 1 deletion Codecs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

if ( ${IMCODEC_BUILD_CODEC_BMP})
add_subdirectory(CodecBMP)
Expand Down
2 changes: 1 addition & 1 deletion Codecs/CodecBMP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Codec Icon
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

project(CodecBMP)

Expand Down
2 changes: 1 addition & 1 deletion Codecs/CodecDDS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Codec DDS
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

project(CodecDDS)

Expand Down
22 changes: 14 additions & 8 deletions Codecs/CodecFreeImage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#CodecFreeImage

cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

# Add source to this project's executable.
file(GLOB_RECURSE sourceFiles
Expand All @@ -10,11 +10,17 @@ file(GLOB_RECURSE sourceFiles

set(TargetName CodecFreeImage)
add_library (${TargetName} STATIC ${sourceFiles})
target_link_libraries(${TargetName} d:/DevelopmentExternal/FreeImage3180Win32Win64/FreeImage/Dist/x64/FreeImage.lib)
include_directories(D:/DevelopmentExternal/FreeImage3180Win32Win64/FreeImage/Dist/x64)

#FreeImage from source
#set(FreeImageFolder ../../External/FreeImage)
#add_subdirectory(${FreeImageFolder} ./External/FreeImage)
#target_include_directories(${TargetName} PRIVATE ${FreeImageFolder}/Source)
#target_link_libraries(${TargetName} PRIVATE FreeImage)
set(FreeImageReFolder ${CMAKE_CURRENT_LIST_DIR}/../../External/FreeImageRe)
set(EXTERNALPROJECT_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR}/External/FreeImageRe/dependencies/source CACHE PATH "FreeImageRe dependency source directory")
set(EXTERNALPROJECT_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/External/FreeImageRe/dependencies/build CACHE PATH "FreeImageRe dependency build directory")
foreach(FreeImageReBackend LIBJPEG LIBOPENJPEG LIBOPENEXR LIBPNG LIBTIFF LIBWEBP LIBRAW LIBHEIF LIBJPEGXL)
set(FREEIMAGE_WITH_${FreeImageReBackend} OFF CACHE BOOL "Compile FreeImageRe with the ${FreeImageReBackend} backend" FORCE)
endforeach()

if(NOT TARGET FreeImage)
add_subdirectory(${FreeImageReFolder} ${CMAKE_CURRENT_BINARY_DIR}/External/FreeImageRe)
endif()

target_include_directories(${TargetName} PRIVATE ${FreeImageReFolder}/Source)
target_link_libraries(${TargetName} PRIVATE FreeImage)
20 changes: 10 additions & 10 deletions Codecs/CodecFreeImage/Source/CodecFreeImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ namespace IMCodec
// {0CA17E19-92E7-4926-A8FC-34E7086BA27F}
{ 0xca17e19, 0x92e7, 0x4926, { 0xa8, 0xfc, 0x34, 0xe7, 0x8, 0x6b, 0xa2, 0x7f } }
,CodecCapabilities::Decode | CodecCapabilities::BulkCodec
, L"Free image codec"
, LLUTILS_TEXT("Free image codec")
,
{
{
{ L"Image formats collection"}
{ LLUTILS_TEXT("Image formats collection")}

,{ L"BMP",L"ICO",L"JPEG",L"JNG",L"KOALA",L"LBM",L"IFF",L"MNG",L"PBM",L"PBMRAW",L"PCD",L"PGM",L"PGMRAW",L"PNG"
,L"PPM",L"PPMRAW",L"RAS",L"TGA",L"TIFF",L"TIF",L"WBMP",L"PSD",L"CUT",L"XBM",L"XPM",L"DDS",L"GIF",L"HDR",L"FAXG3"
,L"SGI",L"EXR",L"J2K",L"JP2",L"PFM",L"PICT",L"RAW",L"WEBP",L"JXR",L"CUR"
,{ LLUTILS_TEXT("BMP"),LLUTILS_TEXT("ICO"),LLUTILS_TEXT("JNG"),LLUTILS_TEXT("KOALA"),LLUTILS_TEXT("LBM"),LLUTILS_TEXT("IFF"),LLUTILS_TEXT("MNG"),LLUTILS_TEXT("PBM"),LLUTILS_TEXT("PBMRAW"),LLUTILS_TEXT("PCD"),LLUTILS_TEXT("PGM"),LLUTILS_TEXT("PGMRAW")
,LLUTILS_TEXT("PPM"),LLUTILS_TEXT("PPMRAW"),LLUTILS_TEXT("RAS"),LLUTILS_TEXT("TGA"),LLUTILS_TEXT("WBMP"),LLUTILS_TEXT("PSD"),LLUTILS_TEXT("CUT"),LLUTILS_TEXT("XBM"),LLUTILS_TEXT("XPM"),LLUTILS_TEXT("DDS"),LLUTILS_TEXT("GIF")
,LLUTILS_TEXT("HDR"),LLUTILS_TEXT("FAXG3"),LLUTILS_TEXT("SGI"),LLUTILS_TEXT("PFM"),LLUTILS_TEXT("PICT"),LLUTILS_TEXT("JXR"),LLUTILS_TEXT("CUR")
}
}
}
Expand All @@ -49,10 +49,10 @@ namespace IMCodec
if (freeImageHandle && FreeImage_FlipVertical(freeImageHandle))
{

BITMAPINFO* imageInfo = FreeImage_GetInfo(freeImageHandle);
FREE_IMAGE_TYPE TexelFormat = FreeImage_GetImageType(freeImageHandle);
FIBITMAPINFO* imageInfo = FreeImage_GetInfo(freeImageHandle);
FREE_IMAGE_TYPE freeImageType = FreeImage_GetImageType(freeImageHandle);

const BITMAPINFOHEADER& header = imageInfo->bmiHeader;
const FIBITMAPINFOHEADER& header = imageInfo->bmiHeader;

auto imageItem = std::make_shared<ImageItem>();
imageItem->itemType = ImageItemType::Image;
Expand All @@ -67,7 +67,7 @@ namespace IMCodec
imageItem->data.Write(reinterpret_cast<std::byte*>(FreeImage_GetBits(freeImageHandle)), 0, imageSizeInMemory);


switch (TexelFormat)
switch (freeImageType)
{
case FIT_BITMAP:
{
Expand Down Expand Up @@ -120,4 +120,4 @@ namespace IMCodec
return result;
}
};
}
}
2 changes: 1 addition & 1 deletion Codecs/CodecGif/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#CodecGif

cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)


file(GLOB_RECURSE sourceFiles
Expand Down
5 changes: 1 addition & 4 deletions Codecs/CodecGif/Source/CodecGif.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,14 @@ namespace IMCodec
imageItem->descriptor.rowPitchInBytes = IMCodec::GetTexelFormatSize(imageItem->descriptor.texelFormatDecompressed) * imageItem->descriptor.width / CHAR_BIT;
imageItem->data = std::move(frameBuffers.at(imageIndex));
imageItem->animationData.delayMilliseconds = currentFrameData.gcb.DelayTime * 10; // multiply by 10 to convert centiseconds to milliseconds.
imageItem->processData.pluginUsed = GetPluginProperties().id;


//Estimation on frame loading time, since frame are loaded together is a bit cumbersome to precisly time the 'load time'

if (loadTIme == -1)
{
using namespace LLUtils;
loadTIme = static_cast<double>(stopWatch.GetElapsedTimeReal(StopWatch::TimeUnit::Milliseconds));
}

imageItem->processData.processTime = loadTIme;

if (isMultiImage)
out_image->SetSubImage(imageIndex, std::make_shared<Image>(imageItem, ImageItemType::Unknown));
Expand Down
2 changes: 1 addition & 1 deletion Codecs/CodecIcon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Codec Icon
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

project(CodecIcon)

Expand Down
Loading
Loading