From edfa6730fa9f1dca77dd27c0b3a643171e082950 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Wed, 6 Nov 2024 15:54:32 +0100 Subject: [PATCH] KImageFormats: Added SCITEX plugin and updated libraries (#12690) Apply the following changes to the KImageFormats project: - Moved EXR lib to branch 3.3 - Update AVIF lib to latest patch release - Added SCITEX plugin to fuzzer test - Fixed KDE/extra-cmake-modules build error --- projects/kimageformats/Dockerfile | 4 ++-- projects/kimageformats/build.sh | 19 ++++++++++--------- projects/kimageformats/kimgio_fuzzer.cc | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/projects/kimageformats/Dockerfile b/projects/kimageformats/Dockerfile index f479c5f3edda..9bbb3d3e3043 100644 --- a/projects/kimageformats/Dockerfile +++ b/projects/kimageformats/Dockerfile @@ -21,13 +21,13 @@ RUN git clone --depth 1 https://github.com/facebook/zstd.git RUN git clone --depth 1 https://github.com/nih-at/libzip.git RUN wget https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz RUN git clone https://github.com/tukaani-project/xz.git -RUN git clone --depth 1 --branch=RB-3.2 https://github.com/AcademySoftwareFoundation/openexr.git +RUN git clone --depth 1 --branch=RB-3.3 https://github.com/AcademySoftwareFoundation/openexr.git RUN git clone --depth 1 -b master https://invent.kde.org/frameworks/extra-cmake-modules.git RUN git clone --depth 1 --branch=dev git://code.qt.io/qt/qtbase.git RUN git clone --depth 1 -b master https://invent.kde.org/frameworks/karchive.git RUN git clone --depth 1 -b master https://invent.kde.org/frameworks/kimageformats.git RUN git clone --depth 1 -b v3.9.1 https://aomedia.googlesource.com/aom -RUN git clone --depth 1 -b v1.1.0 https://github.com/AOMediaCodec/libavif.git +RUN git clone --depth 1 -b v1.1.1 https://github.com/AOMediaCodec/libavif.git RUN git clone --depth 1 https://github.com/strukturag/libde265.git RUN git clone --depth 1 -b v2.5.2 https://github.com/uclouvain/openjpeg.git RUN git clone --depth 1 https://github.com/strukturag/libheif.git diff --git a/projects/kimageformats/build.sh b/projects/kimageformats/build.sh index f36de680961c..2d2ebe80eba9 100644 --- a/projects/kimageformats/build.sh +++ b/projects/kimageformats/build.sh @@ -62,22 +62,22 @@ make install -j$(nproc) export CFLAGS="${ORIG_CFLAGS}" export CXXFLAGS="${ORIG_CXXFLAGS}" -# Build extra-cmake-modules -cd $SRC -cd extra-cmake-modules -cmake . -make install -j$(nproc) - cd $SRC cd qtbase ./configure -no-glib -qt-libpng -qt-pcre -opensource -confirm-license -static -no-opengl -no-icu -platform linux-clang-libc++ -debug -prefix /usr -no-feature-widgets -no-feature-sql -no-feature-network -no-feature-xml -no-feature-dbus -no-feature-printsupport cmake --build . --parallel $(nproc) cmake --install . +# Build extra-cmake-modules +cd $SRC +cd extra-cmake-modules +cmake . -DBUILD_TESTING=OFF +make install -j$(nproc) + cd $SRC cd karchive rm -rf poqm -cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF +cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr/local make install -j$(nproc) # Build JXRlib @@ -140,7 +140,7 @@ cd $SRC cd openexr mkdir _build cd _build -cmake -DBUILD_SHARED_LIBS=OFF .. +cmake -DBUILD_SHARED_LIBS=OFF .. make -j$(nproc) make install -j$(nproc) @@ -184,6 +184,7 @@ HANDLER_TYPES="ANIHandler ani RASHandler ras RAWHandler raw RGBHandler rgb + ScitexHandler sct TGAHandler tga XCFHandler xcf" @@ -194,7 +195,7 @@ echo "$HANDLER_TYPES" | while read class format; do /usr/libexec/moc $SRC/kimageformats/src/imageformats/$format.cpp -o $format.moc header=`ls $SRC/kimageformats/src/imageformats/$format*.h` /usr/libexec/moc $header -o moc_`basename $header .h`.cpp - $CXX $CXXFLAGS -fPIC -DHANDLER=$class -std=c++17 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/$format.cpp $SRC/kimageformats/src/imageformats/scanlineconverter.cpp -o $OUT/$fuzz_target_name -DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -DJXL_CMS_STATIC_DEFINE -DINITGUID -I $SRC/kimageformats/src/imageformats/ -I $SRC/libavif/include/ -I $SRC/libjxl/build/lib/include/ -I $SRC/libjxl/lib/include/ -I /usr/local/include/OpenEXR/ -I /usr/local/include/KF6/KArchive/ -I /usr/local/include/Imath -I $SRC/jxrlib/common/include -I $SRC/jxrlib/jxrgluelib -I $SRC/jxrlib/image/sys -I /usr/include/QtCore/ -I /usr/include/QtGui/ -I . $SRC/libavif/build/libavif.a /usr/local/lib/libheif.a /usr/local/lib/libde265.a $SRC/aom/build.libavif/libaom.a $SRC/libjxl/build/lib/libjxl_threads.a $SRC/libjxl/build/lib/libjxl.a $SRC/libjxl/build/lib/libjxl_cms.a $SRC/libjxl/build/third_party/highway/libhwy.a $SRC/libjxl/build/third_party/brotli/libbrotlidec.a $SRC/libjxl/build/third_party/brotli/libbrotlienc.a $SRC/libjxl/build/third_party/brotli/libbrotlicommon.a -lQt6Gui -lQt6Core -lQt6BundledLibpng -lQt6BundledHarfbuzz -lm -lQt6BundledPcre2 -ldl -lpthread $LIB_FUZZING_ENGINE /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF6Archive /usr/local/lib/libz.a /usr/local/lib/libraw.a /usr/local/lib/libOpenEXR-3_2.a /usr/local/lib/libIex-3_2.a /usr/local/lib/libImath-3_1.a /usr/local/lib/libIlmThread-3_2.a /usr/local/lib/libOpenEXRCore-3_2.a /usr/local/lib/libOpenEXRUtil-3_2.a /usr/local/lib/libopenjp2.a /usr/local/lib/libzstd.a $SRC/jxrlib/build/libjxrglue.a $SRC/jxrlib/build/libjpegxr.a -llzma /usr/local/lib/libbz2.a -lclang_rt.builtins + $CXX $CXXFLAGS -fPIC -DHANDLER=$class -std=c++17 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/$format.cpp $SRC/kimageformats/src/imageformats/scanlineconverter.cpp -o $OUT/$fuzz_target_name -DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -DJXL_CMS_STATIC_DEFINE -DINITGUID -I $SRC/kimageformats/src/imageformats/ -I $SRC/libavif/include/ -I $SRC/libjxl/build/lib/include/ -I $SRC/libjxl/lib/include/ -I /usr/local/include/OpenEXR/ -I /usr/local/include/KF6/KArchive/ -I /usr/local/include/Imath -I $SRC/jxrlib/common/include -I $SRC/jxrlib/jxrgluelib -I $SRC/jxrlib/image/sys -I /usr/include/QtCore/ -I /usr/include/QtGui/ -I . $SRC/libavif/build/libavif.a /usr/local/lib/libheif.a /usr/local/lib/libde265.a $SRC/aom/build.libavif/libaom.a $SRC/libjxl/build/lib/libjxl_threads.a $SRC/libjxl/build/lib/libjxl.a $SRC/libjxl/build/lib/libjxl_cms.a $SRC/libjxl/build/third_party/highway/libhwy.a $SRC/libjxl/build/third_party/brotli/libbrotlidec.a $SRC/libjxl/build/third_party/brotli/libbrotlienc.a $SRC/libjxl/build/third_party/brotli/libbrotlicommon.a -lQt6Gui -lQt6Core -lQt6BundledLibpng -lQt6BundledHarfbuzz -lm -lQt6BundledPcre2 -ldl -lpthread $LIB_FUZZING_ENGINE /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF6Archive /usr/local/lib/libz.a /usr/local/lib/libraw.a /usr/local/lib/libOpenEXR-3_3.a /usr/local/lib/libIex-3_3.a /usr/local/lib/libImath-3_1.a /usr/local/lib/libIlmThread-3_3.a /usr/local/lib/libOpenEXRCore-3_3.a /usr/local/lib/libOpenEXRUtil-3_3.a /usr/local/lib/libopenjp2.a /usr/local/lib/libzstd.a $SRC/jxrlib/build/libjxrglue.a $SRC/jxrlib/build/libjpegxr.a -llzma /usr/local/lib/libbz2.a -lclang_rt.builtins # -lclang_rt.builtins in the previous line is a temporary workaround to avoid a linker error "undefined reference to __truncsfhf2". Investigate why this is needed here, but not anywhere else, and possibly remove it. diff --git a/projects/kimageformats/kimgio_fuzzer.cc b/projects/kimageformats/kimgio_fuzzer.cc index b1733eb237e5..9d89da4d7cd2 100644 --- a/projects/kimageformats/kimgio_fuzzer.cc +++ b/projects/kimageformats/kimgio_fuzzer.cc @@ -20,7 +20,7 @@ Usage: python infra/helper.py build_image kimageformats python infra/helper.py build_fuzzers --sanitizer undefined|address|memory kimageformats - python infra/helper.py run_fuzzer kimageformats kimgio_[ani|avif|exr|hdr|heif|jxl|jxr|kra|ora|pcx|pfm|pic|psd|pxr|qoi|ras|raw|rgb|tga|xcf]_fuzzer + python infra/helper.py run_fuzzer kimageformats kimgio_[ani|avif|exr|hdr|heif|jxl|jxr|kra|ora|pcx|pfm|pic|psd|pxr|qoi|ras|raw|rgb|sct|tga|xcf]_fuzzer */ @@ -46,6 +46,7 @@ #include "ras_p.h" #include "raw_p.h" #include "rgb_p.h" +#include "sct_p.h" #include "tga_p.h" #include "xcf_p.h"