Code Monkey home page Code Monkey logo

Comments (4)

cgohlke avatar cgohlke commented on June 15, 2024

----------------------------- 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.

from imagecodecs.

kevinsmia1939 avatar kevinsmia1939 commented on June 15, 2024

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']

from imagecodecs.

cgohlke avatar cgohlke commented on June 15, 2024

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:

imagecodecs/setup.py

Lines 301 to 314 in f38d0d4

# customize builds based on environment
try:
from imagecodecs_distributor_setup import customize_build
except ImportError:
if os.environ.get('COMPUTERNAME', '').startswith('CG-'):
customize_build = customize_build_cg
elif os.environ.get('LD_LIBRARY_PATH', os.environ.get('LIBRARY_PATH', '')):
customize_build = customize_build_ci
elif os.environ.get('LIBRARY_INC', ''):
customize_build = customize_build_cf
else:
customize_build = customize_build_default
customize_build(EXTENSIONS, OPTIONS)

from imagecodecs.

kevinsmia1939 avatar kevinsmia1939 commented on June 15, 2024

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

from imagecodecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.