Write tests for hej2 format

This commit is contained in:
Daniel Novomeský 2025-03-16 18:40:17 +01:00
parent 9bee29cc01
commit 473f5d9847
38 changed files with 78 additions and 6 deletions

View File

@ -122,6 +122,9 @@ if (LibHeif_FOUND)
kimageformats_read_tests(FUZZ 1 kimageformats_read_tests(FUZZ 1
hej2 hej2
) )
kimageformats_write_tests(FUZZ 1
hej2-nodatacheck-lossless
)
endif() endif()
if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.19.6") if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.19.6")

View File

@ -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
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -634,14 +634,18 @@ int main(int argc, char **argv)
const QList<QByteArray> read_formats = QImageReader::supportedImageFormats(); const QList<QByteArray> read_formats = QImageReader::supportedImageFormats();
const QList<QByteArray> write_formats = QImageWriter::supportedImageFormats(); const QList<QByteArray> write_formats = QImageWriter::supportedImageFormats();
if (!read_formats.contains(format) && format == "heif") { if (!read_formats.contains(format)) {
QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n"; if (format == "heif" || format == "hej2") {
return 0; QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n";
return 0;
}
} }
if (!write_formats.contains(format) && format == "heif") { if (!write_formats.contains(format)) {
QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n"; if (format == "heif" || format == "hej2") {
return 0; QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n";
return 0;
}
} }
// run test // run test