diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 037d56f..b4232bd 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -122,6 +122,9 @@ if (LibHeif_FOUND) kimageformats_read_tests(FUZZ 1 hej2 ) + kimageformats_write_tests(FUZZ 1 + hej2-nodatacheck-lossless + ) endif() if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.19.6") diff --git a/autotests/write/basic/hej2.json b/autotests/write/basic/hej2.json new file mode 100644 index 0000000..28c1e17 --- /dev/null +++ b/autotests/write/basic/hej2.json @@ -0,0 +1,65 @@ +{ + "format" : "hej2", + "metadata" : [ + { + "key" : "CreationDate", + "value" : "2025-01-14T13:53:32+01:00" + }, + { + "key" : "Direction", + "value" : "123.7" + }, + { + "key" : "ModificationDate", + "value" : "2025-02-14T15:58:44+01:00" + }, + { + "key" : "Software" , + "value" : "Adobe Photoshop 26.2 (Windows)" + }, + { + "key" : "Altitude", + "value" : "34" + }, + { + "key" : "Author", + "value" : "KDE Project" + }, + { + "key" : "Copyright", + "value" : "@2025 KDE Project" + }, + { + "key" : "Description", + "value" : "TV broadcast test image." + }, + { + "key" : "Latitude", + "value" : "44.6478" + }, + { + "key" : "LensManufacturer", + "value" : "KDE Glasses" + }, + { + "key" : "LensModel", + "value" : "A1234" + }, + { + "key" : "Longitude", + "value" : "10.9254" + }, + { + "key" : "Manufacturer", + "value" : "KFramework" + }, + { + "key" : "Model", + "value" : "KImageFormats" + } + ], + "resolution" : { + "dotsPerMeterX" : 11811, + "dotsPerMeterY" : 11812 + } +} diff --git a/autotests/write/format/hej2/Format_A2BGR30_Premultiplied.hej2 b/autotests/write/format/hej2/Format_A2BGR30_Premultiplied.hej2 new file mode 100644 index 0000000..7ada2e0 Binary files /dev/null and b/autotests/write/format/hej2/Format_A2BGR30_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_A2RGB30_Premultiplied.hej2 b/autotests/write/format/hej2/Format_A2RGB30_Premultiplied.hej2 new file mode 100644 index 0000000..7ada2e0 Binary files /dev/null and b/autotests/write/format/hej2/Format_A2RGB30_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB32.hej2 b/autotests/write/format/hej2/Format_ARGB32.hej2 new file mode 100644 index 0000000..5c89cca Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB32.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB32_Premultiplied.hej2 b/autotests/write/format/hej2/Format_ARGB32_Premultiplied.hej2 new file mode 100644 index 0000000..cbb2fa7 Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB32_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB4444_Premultiplied.hej2 b/autotests/write/format/hej2/Format_ARGB4444_Premultiplied.hej2 new file mode 100644 index 0000000..3dce6cf Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB4444_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB6666_Premultiplied.hej2 b/autotests/write/format/hej2/Format_ARGB6666_Premultiplied.hej2 new file mode 100644 index 0000000..1caf272 Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB6666_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB8555_Premultiplied.hej2 b/autotests/write/format/hej2/Format_ARGB8555_Premultiplied.hej2 new file mode 100644 index 0000000..456a178 Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB8555_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_ARGB8565_Premultiplied.hej2 b/autotests/write/format/hej2/Format_ARGB8565_Premultiplied.hej2 new file mode 100644 index 0000000..f9e4646 Binary files /dev/null and b/autotests/write/format/hej2/Format_ARGB8565_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_BGR30.hej2 b/autotests/write/format/hej2/Format_BGR30.hej2 new file mode 100644 index 0000000..6401c69 Binary files /dev/null and b/autotests/write/format/hej2/Format_BGR30.hej2 differ diff --git a/autotests/write/format/hej2/Format_BGR888.hej2 b/autotests/write/format/hej2/Format_BGR888.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_BGR888.hej2 differ diff --git a/autotests/write/format/hej2/Format_CMYK8888.hej2 b/autotests/write/format/hej2/Format_CMYK8888.hej2 new file mode 100644 index 0000000..5f3e8ab Binary files /dev/null and b/autotests/write/format/hej2/Format_CMYK8888.hej2 differ diff --git a/autotests/write/format/hej2/Format_Grayscale16.hej2 b/autotests/write/format/hej2/Format_Grayscale16.hej2 new file mode 100644 index 0000000..acfebc5 Binary files /dev/null and b/autotests/write/format/hej2/Format_Grayscale16.hej2 differ diff --git a/autotests/write/format/hej2/Format_Grayscale8.hej2 b/autotests/write/format/hej2/Format_Grayscale8.hej2 new file mode 100644 index 0000000..4a3a592 Binary files /dev/null and b/autotests/write/format/hej2/Format_Grayscale8.hej2 differ diff --git a/autotests/write/format/hej2/Format_Indexed8.hej2 b/autotests/write/format/hej2/Format_Indexed8.hej2 new file mode 100644 index 0000000..4a2ab2f Binary files /dev/null and b/autotests/write/format/hej2/Format_Indexed8.hej2 differ diff --git a/autotests/write/format/hej2/Format_Mono.hej2 b/autotests/write/format/hej2/Format_Mono.hej2 new file mode 100644 index 0000000..2762455 Binary files /dev/null and b/autotests/write/format/hej2/Format_Mono.hej2 differ diff --git a/autotests/write/format/hej2/Format_MonoLSB.hej2 b/autotests/write/format/hej2/Format_MonoLSB.hej2 new file mode 100644 index 0000000..2762455 Binary files /dev/null and b/autotests/write/format/hej2/Format_MonoLSB.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB16.hej2 b/autotests/write/format/hej2/Format_RGB16.hej2 new file mode 100644 index 0000000..5b5d08d Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB16.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB30.hej2 b/autotests/write/format/hej2/Format_RGB30.hej2 new file mode 100644 index 0000000..6401c69 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB30.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB32.hej2 b/autotests/write/format/hej2/Format_RGB32.hej2 new file mode 100644 index 0000000..cc03401 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB32.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB444.hej2 b/autotests/write/format/hej2/Format_RGB444.hej2 new file mode 100644 index 0000000..8e4a70f Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB444.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB555.hej2 b/autotests/write/format/hej2/Format_RGB555.hej2 new file mode 100644 index 0000000..5db343d Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB555.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB666.hej2 b/autotests/write/format/hej2/Format_RGB666.hej2 new file mode 100644 index 0000000..352ec9e Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB666.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGB888.hej2 b/autotests/write/format/hej2/Format_RGB888.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGB888.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA16FPx4.hej2 b/autotests/write/format/hej2/Format_RGBA16FPx4.hej2 new file mode 100644 index 0000000..acb65e6 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA16FPx4.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA16FPx4_Premultiplied.hej2 b/autotests/write/format/hej2/Format_RGBA16FPx4_Premultiplied.hej2 new file mode 100644 index 0000000..acb65e6 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA16FPx4_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA32FPx4.hej2 b/autotests/write/format/hej2/Format_RGBA32FPx4.hej2 new file mode 100644 index 0000000..acb65e6 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA32FPx4.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA32FPx4_Premultiplied.hej2 b/autotests/write/format/hej2/Format_RGBA32FPx4_Premultiplied.hej2 new file mode 100644 index 0000000..acb65e6 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA32FPx4_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA64.hej2 b/autotests/write/format/hej2/Format_RGBA64.hej2 new file mode 100644 index 0000000..5c89cca Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA64.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA64_Premultiplied.hej2 b/autotests/write/format/hej2/Format_RGBA64_Premultiplied.hej2 new file mode 100644 index 0000000..acb65e6 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA64_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA8888.hej2 b/autotests/write/format/hej2/Format_RGBA8888.hej2 new file mode 100644 index 0000000..5c89cca Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA8888.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBA8888_Premultiplied.hej2 b/autotests/write/format/hej2/Format_RGBA8888_Premultiplied.hej2 new file mode 100644 index 0000000..cbb2fa7 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBA8888_Premultiplied.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBX16FPx4.hej2 b/autotests/write/format/hej2/Format_RGBX16FPx4.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBX16FPx4.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBX32FPx4.hej2 b/autotests/write/format/hej2/Format_RGBX32FPx4.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBX32FPx4.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBX64.hej2 b/autotests/write/format/hej2/Format_RGBX64.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBX64.hej2 differ diff --git a/autotests/write/format/hej2/Format_RGBX8888.hej2 b/autotests/write/format/hej2/Format_RGBX8888.hej2 new file mode 100644 index 0000000..22c0d55 Binary files /dev/null and b/autotests/write/format/hej2/Format_RGBX8888.hej2 differ diff --git a/autotests/writetest.cpp b/autotests/writetest.cpp index 8fbb228..91238b7 100644 --- a/autotests/writetest.cpp +++ b/autotests/writetest.cpp @@ -634,14 +634,18 @@ int main(int argc, char **argv) const QList read_formats = QImageReader::supportedImageFormats(); const QList write_formats = QImageWriter::supportedImageFormats(); - if (!read_formats.contains(format) && format == "heif") { - QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n"; - return 0; + if (!read_formats.contains(format)) { + if (format == "heif" || format == "hej2") { + QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n"; + return 0; + } } - if (!write_formats.contains(format) && format == "heif") { - QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n"; - return 0; + if (!write_formats.contains(format)) { + if (format == "heif" || format == "hej2") { + QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n"; + return 0; + } } // run test