conda-forge / graphicsmagick-feedstock

A conda-smithy repository for graphicsmagick.
BSD 3-Clause "New" or "Revised" License
0 stars 6 forks source link

Quantum depth is limited to 8 bits per pixel #34

Open matteosecli opened 2 months ago

matteosecli commented 2 months ago

Solution to issue cannot be found in the documentation.

Issue

As currently compiled, this library can only process 8-bit images. This causes issues with several programs that make use of the library, such as Krita (see bug report), Octave (see docs), etc.

The library should be built with the option --with-quantum-depth=16. It's also possible to produce multiple co-existing variants with different quantum depths with the additional option --enable-quantum-library-names (but you can use only one at a time).

Major distributions and package managers have long been building 16-bit versions. I surveyed a few below:

I confirmed the issue with this package on MacOS (Apple Silicon) by building octave against it and trying to open a photo taken with a smartphone. I obtained

octave:1> imread('/Users/matteo/Downloads/photo.jpg');
warning: your version of GraphicsMagick limits images to 8 bits per pixel

I can open a PR with the necessary change in build.sh if that looks good to you.

Installed packages

# packages in environment at /opt/homebrew/Caskroom/miniconda/base/envs/octave-test:
#
# Name                    Version                   Build  Channel
arpack                    3.9.1           nompi_h593882a_101    conda-forge
bzip2                     1.0.8                h80987f9_6  
c-ares                    1.33.1               hd74edd7_0    conda-forge
ca-certificates           2024.8.30            hf0a4a13_0    conda-forge
cairo                     1.18.0               hc6c324b_2    conda-forge
curl                      8.10.0               h13a7ad3_0    conda-forge
expat                     2.6.3                hf9b8971_0    conda-forge
fftw                      3.3.10          nompi_h6637ab6_110    conda-forge
fltk                      1.3.9                h5164b75_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_2    conda-forge
fontconfig                2.14.2               h82840c6_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               hadb7bae_2    conda-forge
fribidi                   1.0.10               h27ca646_0    conda-forge
gettext                   0.22.5               h8414b35_3    conda-forge
gettext-tools             0.22.5               h8414b35_3    conda-forge
ghostscript               10.03.1              hdba4b6b_0    conda-forge
giflib                    5.2.2                h93a5062_0    conda-forge
gl2ps                     1.4.2                hc97c1ff_1    conda-forge
glib                      2.80.3               h59d46d9_2    conda-forge
glib-tools                2.80.3               h8ba3eef_2    conda-forge
glpk                      5.0                  h6d7a090_0    conda-forge
gmp                       6.3.0                h7bae524_2    conda-forge
gnuplot                   5.4.10               h3922d9a_0    conda-forge
graphicsmagick            1.3.45               hf0415ff_0    conda-forge
graphite2                 1.3.13            hebf3989_1003    conda-forge
gst-plugins-base          1.24.7               hb49d354_0    conda-forge
gstreamer                 1.24.7               hc3f5269_0    conda-forge
harfbuzz                  9.0.0                h1836168_0    conda-forge
hdf5                      1.14.3          nompi_hec07895_105    conda-forge
icu                       73.2                 hc8870d7_0    conda-forge
krb5                      1.21.3               h237132a_0    conda-forge
lame                      3.100             h1a8c8d9_1003    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libaec                    1.1.3                hebf3989_0    conda-forge
libasprintf               0.22.5               h8414b35_3    conda-forge
libasprintf-devel         0.22.5               h8414b35_3    conda-forge
libblas                   3.9.0           23_osxarm64_openblas    conda-forge
libcblas                  3.9.0           23_osxarm64_openblas    conda-forge
libclang-cpp15            15.0.7          default_he012953_5    conda-forge
libclang13                18.1.8          default_hfc66aa2_4    conda-forge
libcurl                   8.10.0               h13a7ad3_0    conda-forge
libcxx                    18.1.8               h3ed4263_7    conda-forge
libdeflate                1.21                 h99b78c6_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h93a5062_2    conda-forge
libexpat                  2.6.3                hf9b8971_0    conda-forge
libffi                    3.4.4                hca03da5_1  
libflac                   1.4.3                hb765f3a_0    conda-forge
libgd                     2.3.3                hfdf3952_9    conda-forge
libgettextpo              0.22.5               h8414b35_3    conda-forge
libgettextpo-devel        0.22.5               h8414b35_3    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
libglib                   2.80.3               h59d46d9_2    conda-forge
libhwloc                  2.11.1          default_h7685b71_1000    conda-forge
libiconv                  1.17                 h0d3ecfb_2    conda-forge
libintl                   0.22.5               h8414b35_3    conda-forge
libintl-devel             0.22.5               h8414b35_3    conda-forge
libjpeg-turbo             3.0.0                hb547adb_1    conda-forge
liblapack                 3.9.0           23_osxarm64_openblas    conda-forge
liblapacke                3.9.0           23_osxarm64_openblas    conda-forge
libllvm15                 15.0.7               h2621b3d_4    conda-forge
libllvm18                 18.1.8               h5090b49_2    conda-forge
libnghttp2                1.58.0               ha4dd798_1    conda-forge
libogg                    1.3.5                h99b78c6_0    conda-forge
libopenblas               0.3.27          openmp_h517c56d_1    conda-forge
libopus                   1.3.1                h27ca646_1    conda-forge
libpng                    1.6.44               hc14010f_0    conda-forge
libpq                     16.4                 h671472c_1    conda-forge
libsndfile                1.2.2                h9739721_1    conda-forge
libsqlite                 3.46.1               hc14010f_0    conda-forge
libssh2                   1.11.0               h7a5bd25_0    conda-forge
libtiff                   4.6.0                hf8409c0_4    conda-forge
libvorbis                 1.3.7                h9f76cd9_0    conda-forge
libwebp                   1.4.0                h54798ee_0    conda-forge
libwebp-base              1.4.0                h93a5062_0    conda-forge
libxcb                    1.16                 hc9fafa5_1    conda-forge
libxml2                   2.12.7               h9a80f22_3    conda-forge
libzlib                   1.3.1                hfb2fe0b_1    conda-forge
llvm-openmp               18.1.8               hde57baf_1    conda-forge
metis                     5.1.0             h13dd4ca_1007    conda-forge
mpfr                      4.2.1                hb693164_3    conda-forge
mpg123                    1.32.6               hebf3989_0    conda-forge
mysql-common              8.3.0                h1687695_5    conda-forge
mysql-libs                8.3.0                h0e80b4a_5    conda-forge
ncurses                   6.5                  h7bae524_1    conda-forge
nspr                      4.35                 hb7217d7_0    conda-forge
nss                       3.104                hd1ce637_0    conda-forge
octave                    9.2.0                hd8a4ab9_1    file:///Users/matteo/GitHub/octave-feedstock/miniforge3/conda-bld
openssl                   3.3.2                h8359307_0    conda-forge
packaging                 24.1               pyhd8ed1ab_0    conda-forge
pango                     1.54.0               h9ee27a3_2    conda-forge
pcre                      8.45                 hbdafb3b_0    conda-forge
pcre2                     10.44                h297a79d_2    conda-forge
perl                      5.32.1          7_h4614cfb_perl5    conda-forge
pip                       24.2            py310hca03da5_0  
pixman                    0.43.4               hebf3989_0    conda-forge
ply                       3.11               pyhd8ed1ab_2    conda-forge
portaudio                 19.6.0               h13dd4ca_9    conda-forge
pthread-stubs             0.4               h27ca646_1001    conda-forge
pyqt                      5.15.9          py310h2924129_5    conda-forge
pyqt5-sip                 12.12.2         py310h1253130_5    conda-forge
python                    3.10.14         h2469fbe_0_cpython    conda-forge
python_abi                3.10                    5_cp310    conda-forge
qhull                     2020.2               h420ef59_5    conda-forge
qscintilla2               2.14.1          py310hcf420b7_0    conda-forge
qt-main                   5.15.8              hcd44e0d_23    conda-forge
readline                  8.2                  h1a28f6b_0  
setuptools                72.1.0          py310hca03da5_0  
sip                       6.7.12          py310hd5a4765_0    conda-forge
sqlite                    3.46.1               h3b4c4e4_0    conda-forge
suitesparse               7.8.2                hec630bf_0    conda-forge
sundials                  7.1.1                h252a1ed_0    conda-forge
tbb                       2021.13.0            h7b3277c_0    conda-forge
texinfo                   7.0             pl5321h9ea1dce_0    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h04d1e81_0  
wheel                     0.44.0          py310hca03da5_0  
xorg-fixesproto           5.0               h3422bc3_1002    conda-forge
xorg-kbproto              1.0.7             h27ca646_1002    conda-forge
xorg-libice               1.1.1                hb547adb_0    conda-forge
xorg-libsm                1.2.4                hb547adb_0    conda-forge
xorg-libx11               1.8.9                he5f3e76_1    conda-forge
xorg-libxau               1.0.11               hb547adb_0    conda-forge
xorg-libxdmcp             1.1.3                h27ca646_0    conda-forge
xorg-libxext              1.3.4                h1a8c8d9_2    conda-forge
xorg-libxfixes            5.0.3             h3422bc3_1004    conda-forge
xorg-libxrender           0.9.11               hb547adb_0    conda-forge
xorg-renderproto          0.11.1            h27ca646_1002    conda-forge
xorg-xextproto            7.3.0             h1a8c8d9_1003    conda-forge
xorg-xproto               7.0.31            h27ca646_1007    conda-forge
xz                        5.4.6                h80987f9_1  
zlib                      1.3.1                hfb2fe0b_1    conda-forge
zstd                      1.5.6                hb46c0d2_0    conda-forge

Environment info

active environment : octave-test
    active env location : /opt/homebrew/Caskroom/miniconda/base/envs/octave-test
            shell level : 1
       user config file : /Users/matteo/.condarc
 populated config files : /Users/matteo/.condarc
          conda version : 24.7.1
    conda-build version : not installed
         python version : 3.12.4.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.7.1=0
                          __osx=14.6.1=0
                          __unix=0=0
       base environment : /opt/homebrew/Caskroom/miniconda/base  (writable)
      conda av data dir : /opt/homebrew/Caskroom/miniconda/base/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/homebrew/Caskroom/miniconda/base/pkgs
                          /Users/matteo/.conda/pkgs
       envs directories : /opt/homebrew/Caskroom/miniconda/base/envs
                          /Users/matteo/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.7.1 requests/2.32.3 CPython/3.12.4 Darwin/23.6.0 OSX/14.6.1 solver/libmamba conda-libmamba-solver/24.7.0 libmambapy/1.5.8 aau/0.4.4 c/. s/. e/.
                UID:GID : 502:20
             netrc file : None
           offline mode : False
ngam commented 2 months ago

I think it would be a good idea to issue a PR with the desired changes, then maintainers can decide whether or not to accept the changes.

--with-quantum-depth=16 --enable-shared --disable-static --with-magick-plus-plus=yes
matteosecli commented 2 months ago

Thanks for https://github.com/conda-forge/graphicsmagick-feedstock/pull/35, @ngam!