cgohlke / imagecodecs

Image transformation, compression, and decompression codecs
https://pypi.org/project/imagecodecs
BSD 3-Clause "New" or "Revised" License
111 stars 21 forks source link

[openSUSE] test_blosc_roundtrip pytest failed #3

Closed kevinsmia1939 closed 3 years ago

kevinsmia1939 commented 3 years ago

Hello,

I am trying to update imagecodecs for openSUSE Tumbleweed https://build.opensuse.org/package/show/home:andythe_great:branches:devel:languages:python/python-imagecodecs

The test regarding blosc failed, I'm not sure what the issue could be.

The installed dependencies are as follows.

Full log here: https://build.opensuse.org/package/live_build_log/home:andythe_great:branches:devel:languages:python/python-imagecodecs/andythe_great_TW/x86_64

python3-Cython-0.29.21
python3-Pillow-7.2.0
python3-blosc-1.9.1
python3-lz4-3.0.2
python3-matplotlib-3.3.0
python3-numpy-devel-1.18.4
python3-pytest-5.4.3
python3-scikit-image-0.16.2
python3-tifffile-2020.5.30
python3-zstd-1.4.5
CharLS-devel-2.1.0
brunsli-devel-v0.1
giflib-devel-5.1.4
jxrlib-devel-1.1
libaec-devel-1.0.4
libbitstream1-1.4.1
libbrotli-devel
libjpeg62-62.3.0
libtiff-devel-4.1.0
libzopfli-devel-1.0.3
blosc-devel-1.19.0
bzip2-1.0.8
liblcms2-2-2.9
liblz4-devel-1.9.2
liblzma5-5.2.5
libopenjp2-7-2.3.1
libpng16-devel-1.6.37
libwebp-devel-1.1.0
libzstd-devel-1.4.5
zlib-devel-1.2.11
[  194s] =================================== FAILURES ===================================
[  194s] ________________ test_blosc_roundtrip[snappy-noshuffle-None-1] _________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'noshuffle', level = None, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ________________ test_blosc_roundtrip[snappy-noshuffle-None-6] _________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'noshuffle', level = None, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] __________________ test_blosc_roundtrip[snappy-noshuffle-1-1] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'noshuffle', level = 1, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] __________________ test_blosc_roundtrip[snappy-noshuffle-1-6] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'noshuffle', level = 1, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] _________________ test_blosc_roundtrip[snappy-shuffle-None-1] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'shuffle', level = None, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] _________________ test_blosc_roundtrip[snappy-shuffle-None-6] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'shuffle', level = None, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ___________________ test_blosc_roundtrip[snappy-shuffle-1-1] ___________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'shuffle', level = 1, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ___________________ test_blosc_roundtrip[snappy-shuffle-1-6] ___________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'shuffle', level = 1, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ________________ test_blosc_roundtrip[snappy-bitshuffle-None-1] ________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'bitshuffle', level = None, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ________________ test_blosc_roundtrip[snappy-bitshuffle-None-6] ________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'bitshuffle', level = None, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] _________________ test_blosc_roundtrip[snappy-bitshuffle-1-1] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'bitshuffle', level = 1, numthreads = 1
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] _________________ test_blosc_roundtrip[snappy-bitshuffle-1-6] __________________
[  194s] 
[  194s] compressor = 'snappy', shuffle = 'bitshuffle', level = 1, numthreads = 6
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.BLOSC, reason='blosc missing')
[  194s]     @pytest.mark.parametrize('numthreads', [1, 6])
[  194s]     @pytest.mark.parametrize('level', [None, 1])
[  194s]     @pytest.mark.parametrize('shuffle', ['noshuffle', 'shuffle', 'bitshuffle'])
[  194s]     @pytest.mark.parametrize('compressor', ['blosclz', 'lz4', 'lz4hc', 'snappy',
[  194s]                                             'zlib', 'zstd'])
[  194s]     def test_blosc_roundtrip(compressor, shuffle, level, numthreads):
[  194s]         """Test Blosc codec."""
[  194s]         encode = imagecodecs.blosc_encode
[  194s]         decode = imagecodecs.blosc_decode
[  194s]         data = numpy.random.randint(255, size=2021, dtype='uint8').tobytes()
[  194s] >       encoded = encode(data, level=level, compressor=compressor,
[  194s]                          shuffle=shuffle, numthreads=numthreads)
[  194s] 
[  194s] tests/test_imagecodecs.py:927: 
[  194s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  194s] 
[  194s] >   ???
[  194s] E   imagecodecs._blosc.BloscError: blosc_compress_ctx returned -5
[  194s] 
[  194s] imagecodecs\_blosc.pyx:136: BloscError
[  194s] ----------------------------- Captured stderr call -----------------------------
[  194s] Blosc has not been compiled with '(null)' compression support.  Please use one having it.
[  194s] ___________________________ test_jpegxl_encode_jpeg ____________________________
[  194s] 
[  194s]     @pytest.mark.skipif(not imagecodecs.JPEGXL, reason='jpegxl missing')
[  194s]     def test_jpegxl_encode_jpeg():
[  194s]         """Test JPEG XL encoder with JPEG input."""
[  194s]         encode = imagecodecs.jpegxl_encode
[  194s]         decode = imagecodecs.jpegxl_decode
[  194s]         jpg = readfile('rgba.u1.jpg')
[  194s]         jxl = readfile('rgba.u1.jxl')
[  194s]     
[  194s]         assert imagecodecs.jpegxl_check(jpg) in (None, True)
[  194s]         assert imagecodecs.jpegxl_check(jxl) in (None, True)
[  194s]     
[  194s]         encoded = encode(jpg)
[  194s] >       assert encoded == jxl
[  194s] E       assert bytearray(b'\...x17\x1d\xfc#') == b'\n\x04B\xd2...\x93\xbf8\xea'
[  194s] E         At index 13 diff: 11 != 3
[  194s] E         Right contains one more item: 234
[  194s] E         Full diff:
[  194s] E         - (
[  194s] E         -  b'\n\x04B\xd2\xd5N\x12\x08\x08\x1f\x10 \x18\x03 \x00"\x92\x00\x1b@\x10Z\x06'
[  194s] E         ? ^                                              ^                  ----------
[  194s] E         + bytearray(b'\n\x04B\xd2\xd5N\x12\x08\x08\x1f\x10 \x18\x0b \x00"\x92\x00\x1b'...
[  194s] E         
[  194s] E         ...Full output truncated (100 lines hidden), use '-vv' to show
[  194s] 
[  194s] tests/test_imagecodecs.py:1293: AssertionError
[  194s] =========================== short test summary info ============================
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-noshuffle-None-1]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-noshuffle-None-6]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-noshuffle-1-1]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-noshuffle-1-6]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-shuffle-None-1]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-shuffle-None-6]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-shuffle-1-1] - ...
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-shuffle-1-6] - ...
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-bitshuffle-None-1]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-bitshuffle-None-6]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-bitshuffle-1-1]
[  194s] FAILED tests/test_imagecodecs.py::test_blosc_roundtrip[snappy-bitshuffle-1-6]
[  194s] FAILED tests/test_imagecodecs.py::test_jpegxl_encode_jpeg - assert bytearray(...
[  194s] === 13 failed, 3167 passed, 1692 skipped, 1320 xfailed in 111.41s (0:01:51) ====
cgohlke commented 3 years ago

----------------------------- Captured stderr call ----------------------------- Blosc has not been compiled with '(null)' compression support.

Looks like c-blosc has been compiled without support for snappy compression.

FAILED tests/test_imagecodecs.py::test_jpegxl_encode_jpeg

It is possible that the result of the Brunsli repacking is platform or version specific.

kevinsmia1939 commented 3 years ago

Hello,

blosc on openSUSE have been compiled with

-DPREFER_EXTERNAL_SNAPPY=ON \
  -DPREFER_EXTERNAL_ZLIB=ON \
  -DPREFER_EXTERNAL_ZSTD=ON \
  -DPREFER_EXTERNAL_LZ4=ON \
  -DBUILD_STATIC=OFF

https://build.opensuse.org/package/view_file/openSUSE:Factory/blosc/blosc.spec?expand=1

Which seems to enable snappy, but is using the PREFER_EXTERNAL flag the good way to do it?

I'm not sure what you meant by Brunsli repacking is platform or version specific, can you expand on that?

Also, I forgot to mention that I apply a patch, to fix zopfli not found and enable other stuff if that make a difference.

diff -ruN a/imagecodecs/_zopfli.c b/imagecodecs/_zopfli.c
--- a/imagecodecs/_zopfli.c 2020-05-31 07:35:37.000000000 +0700
+++ b/imagecodecs/_zopfli.c 2020-08-11 03:02:56.704879851 +0700
@@ -600,7 +600,7 @@
 #include "numpy/ufuncobject.h"
 #include <stdint.h>
 #include <stdlib.h>
-#include "zopfli/zopfli.h"
+#include "zopfli.h"
 #include "pythread.h"
 #include "pystate.h"
 #ifdef _OPENMP
diff -ruN a/imagecodecs/zopfli.pxd b/imagecodecs/zopfli.pxd
--- a/imagecodecs/zopfli.pxd    2020-02-19 04:42:45.000000000 +0700
+++ b/imagecodecs/zopfli.pxd    2020-08-09 12:44:01.322834958 +0700
@@ -4,7 +4,7 @@
 # Cython declarations for the `Zopfli 1.0.3` library.
 # https://github.com/google/zopfli

-cdef extern from 'zopfli/zopfli.h':
+cdef extern from 'zopfli.h':

     ctypedef struct ZopfliOptions:
         int verbose
diff -ruN a/setup.py b/setup.py
--- a/setup.py  2020-05-31 06:50:56.000000000 +0700
+++ b/setup.py  2020-08-09 12:41:15.565268379 +0700
@@ -148,13 +148,13 @@
     import platform

     del EXTENSIONS['jpeg12']  # jpeg12 requires custom build
-    del EXTENSIONS['jpegls']  # CharLS 2.1 library not commonly available
-    del EXTENSIONS['jpegxl']  # Brunsli library not commonly available
+    # del EXTENSIONS['jpegls']  # CharLS 2.1 library not commonly available
+    # del EXTENSIONS['jpegxl']  # Brunsli library not commonly available
     del EXTENSIONS['lerc']  # LERC library not commonly available
-    del EXTENSIONS['zfp']  # ZFP library not commonly available
+    # del EXTENSIONS['zfp']  # ZFP library not commonly available

-    if 'arch' in platform.platform():
-        del EXTENSIONS['zopfli']  # zopfli/zopfli.h does not exist
+    # if 'arch' in platform.platform():
+    #     del EXTENSIONS['zopfli']  # zopfli/zopfli.h does not exist

     if sys.platform == 'win32':
         EXTENSIONS['bz2']['libraries'] = ['libbz2']
cgohlke commented 3 years ago

Try to build c-blosc with -DDEACTIVATE_SNAPPY=OFF

what you meant by Brunsli repacking is platform or version specific

Brunsli encoding works by taking an existing JPEG stream produced by libjpeg(-turbo) and re-packaging it into a JPEG-XL stream. JPEG does not guarantee bit reproducible results and the Brunsli library is at version 0.1 so I think it is reasonable to expect slight differences in the output, which the imagecodecs tests currently do not account for. Just ignore the failure for now or disable the JPEG-XL codec.

As for your patch, the setup.py file currently supports conda-forge, recent Debian/WSL, the imagecodecs CI build system, and my development setup. On other platforms, either patch setup.py or customize the defaults providing your own imagecodecs_distributor_setup.customize_build function:

https://github.com/cgohlke/imagecodecs/blob/f38d0d4e5db1d08d92742a5d899325fc7c7b56e7/setup.py#L301-L314

kevinsmia1939 commented 3 years ago

I enable snappy in blosc with -DDEACTIVATE_SNAPPY=OFF and disable jpeg-xl codec, the build is now successful.