Skip to content

Commit

Permalink
Merge pull request #13829 from boegel/libjxl05
Browse files Browse the repository at this point in the history
update to libjxl 0.5 + disable building of man pages
  • Loading branch information
Micket authored Sep 3, 2021
2 parents f8dae59 + 366057c commit c65e65c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 36 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
easyblock = 'CMakeMake'

name = 'libjxl'
version = '0.3.7'
version = '0.5'
local_lodepng_version = "48e5364"

homepage = 'https://github.com/libjxl/libjxl'

description = """JPEG XL image format reference implementation"""
description = "JPEG XL image format reference implementation"

toolchain = {'name': 'GCCcore', 'version': '10.3.0'}
toolchainopts = {'optarch': False} # optarch causes some test failures
Expand All @@ -21,14 +20,14 @@ sources = [
'extract_cmd': 'tar -C libjxl-%(version)s/third_party/lodepng --strip-components=1 -xf %s'},
]
patches = [
'libjxl-%(version)s_openexr-3.0_compat.patch',
'libjxl-%(version)s_external_lcms2.patch',
'libjxl-0.3.7_external_lcms2.patch',
'libjxl-%(version)s_remove-broken-test.patch',
]
checksums = [
'8318a5d1ce82e5683a52512b6f242d2b33a1191e89fc76f7c0ead0a1d60f6c60', # v0.3.7.tar.gz
'911cb4b50eb621131ca22382166f40d4914a4ff4453dd299ade1e3292f311f89', # v0.5.tar.gz
'f38176fc103fe1f6d23ba6addd5b14e6a54d546dfaa64663306acfe7b6d912ea', # lodepng-48e5364.tar.gz
'b5bf92b8eb8f41e7cedce1b43ea3fe7a9407d3cc0e29bb2afec652cabe084cee', # libjxl-0.3.7_openexr-3.0_compat.patch
'9e6decaf6be74eeccfd5728df175930b4be33de6cbdf9e1816f68cb4b718fa1b', # libjxl-0.3.7_external_lcms2.patch
'5b62751da5b3b3c4aad58a841d49cc506bc330425bbd0df7f19f99aa98c52c26', # libjxl-0.5_remove-broken-test.patch
]

builddependencies = [
Expand All @@ -51,7 +50,9 @@ dependencies = [
('gperftools', '2.9.1'),
]

configopts = '-DJPEGXL_WARNINGS_AS_ERRORS=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=OFF'
configopts = '-DJPEGXL_WARNINGS_AS_ERRORS=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=OFF '
# building man pages requires/uses asciidoc (which may be installed in OS, and may fail)
configopts += '-DJPEGXL_ENABLE_MANPAGES=OFF'

runtest = "test"

Expand Down
64 changes: 64 additions & 0 deletions easybuild/easyconfigs/l/libjxl/libjxl-0.5_remove-broken-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
remove broken test, see also https://github.com/libjxl/libjxl/issues/500
author: Kenneth Hoste (HPC-UGent)
--- libjxl-0.5/lib/jxl/decode_test.cc.orig 2021-09-03 17:43:40.833113581 +0200
+++ libjxl-0.5/lib/jxl/decode_test.cc 2021-09-03 17:43:51.029009242 +0200
@@ -1701,59 +1701,6 @@
JxlDecoderDestroy(dec);
}

-TEST(DecodeTest, PixelTestWithICCProfileLossy) {
- JxlDecoder* dec = JxlDecoderCreate(NULL);
-
- size_t xsize = 123, ysize = 77;
- size_t num_pixels = xsize * ysize;
- std::vector<uint8_t> pixels = jxl::test::GetSomeTestImage(xsize, ysize, 3, 0);
- JxlPixelFormat format_orig = {3, JXL_TYPE_UINT16, JXL_BIG_ENDIAN, 0};
- jxl::CompressParams cparams;
- jxl::PaddedBytes compressed = jxl::CreateTestJXLCodestream(
- jxl::Span<const uint8_t>(pixels.data(), pixels.size()), xsize, ysize, 3,
- cparams, kCSBF_None, JXL_ORIENT_IDENTITY, /*add_preview=*/false,
- /*add_icc_profile=*/true);
- uint32_t channels = 3;
-
- JxlPixelFormat format = {channels, JXL_TYPE_FLOAT, JXL_LITTLE_ENDIAN, 0};
-
- std::vector<uint8_t> pixels2 = jxl::DecodeWithAPI(
- dec, jxl::Span<const uint8_t>(compressed.data(), compressed.size()),
- format, /*use_callback=*/false, /*set_buffer_early=*/true,
- /*use_resizable_runner=*/false);
- JxlDecoderReset(dec);
- EXPECT_EQ(num_pixels * channels * 4, pixels2.size());
-
- // The input pixels use the profile matching GetIccTestProfile, since we set
- // add_icc_profile for CreateTestJXLCodestream to true.
- jxl::ColorEncoding color_encoding0;
- EXPECT_TRUE(color_encoding0.SetICC(GetIccTestProfile()));
- jxl::Span<const uint8_t> span0(pixels.data(), pixels.size());
- jxl::CodecInOut io0;
- io0.SetSize(xsize, ysize);
- EXPECT_TRUE(ConvertFromExternal(
- span0, xsize, ysize, color_encoding0,
- /*has_alpha=*/false, false, 16, format_orig.endianness,
- /*flipped_y=*/false, /*pool=*/nullptr, &io0.Main()));
-
- // The output pixels are expected to be in the same colorspace as the input
- // profile, as the profile can be represented by enum values.
- jxl::ColorEncoding color_encoding1 = color_encoding0;
- jxl::Span<const uint8_t> span1(pixels2.data(), pixels2.size());
- jxl::CodecInOut io1;
- io1.SetSize(xsize, ysize);
- EXPECT_TRUE(
- ConvertFromExternal(span1, xsize, ysize, color_encoding1,
- /*has_alpha=*/false, false, 32, format.endianness,
- /*flipped_y=*/false, /*pool=*/nullptr, &io1.Main()));
-
- jxl::ButteraugliParams ba;
- EXPECT_LE(ButteraugliDistance(io0, io1, ba, /*distmap=*/nullptr, nullptr),
- 2.4f);
-
- JxlDecoderDestroy(dec);
-}
-
// Tests the case of lossy sRGB image without alpha channel, decoded to RGB8
// and to RGBA8
TEST(DecodeTest, PixelTestOpaqueSrgbLossy) {

0 comments on commit c65e65c

Please sign in to comment.