You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to either update configure/cmake to check for the min version or wrap the 8bit conversion part with whatever was there before. Only recent HEIF have it and most if not all distros do not distribute these versions yet.
I can't replicate on my system, I've built and run (2.3.2 and master) with both CMake and Autotools the project with the test suite while using the latest release of HEIF.
convert_hdr_to_8bit is only available from 1.7 upwards, which is not available widely yet in the distributions.
In any case, whether we support <1.7 or not, we should add checks, in CMake to disable it all if no suitable version has been found, or also in the code if we like to support <1.7.
Run cmake --build /home/runner/work/libgd/libgd/build --config Release
[ 0%] Building C object src/CMakeFiles/gd.dir/gd.c.o
[ 0%] Building C object src/CMakeFiles/gd.dir/gd_avif.c.o
[ 0%] Building C object src/CMakeFiles/gd.dir/gd_bmp.c.o
[ 1%] Building C object src/CMakeFiles/gd.dir/gd_color.c.o
[ 1%] Building C object src/CMakeFiles/gd.dir/gd_color_map.c.o
[ 1%] Building C object src/CMakeFiles/gd.dir/gd_color_match.c.o
[ 1%] Building C object src/CMakeFiles/gd.dir/gd_crop.c.o
[ 1%] Building C object src/CMakeFiles/gd.dir/gd_filename.c.o
[ 2%] Building C object src/CMakeFiles/gd.dir/gd_filter.c.o
[ 2%] Building C object src/CMakeFiles/gd.dir/gd_gd.c.o
[ 2%] Building C object src/CMakeFiles/gd.dir/gd_gd2.c.o
[ 2%] Building C object src/CMakeFiles/gd.dir/gd_gif_in.c.o
[ 2%] Building C object src/CMakeFiles/gd.dir/gd_gif_out.c.o
[ 3%] Building C object src/CMakeFiles/gd.dir/gd_heif.c.o
/home/runner/work/libgd/libgd/src/gd_heif.c: In function ‘_gdImageCreateFromHeifCtx’:
/home/runner/work/libgd/libgd/src/gd_heif.c:187:15: error: ‘struct heif_decoding_options’ has no member named ‘convert_hdr_to_8bit’
187 | heif_dec_opts->convert_hdr_to_8bit = GD_TRUE;
| ^~
make[2]: *** [src/CMakeFiles/gd.dir/build.make:258: src/CMakeFiles/gd.dir/gd_heif.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1946: src/CMakeFiles/gd.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
Error: Process completed with exit code 2.
Sidenote, if you use SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -O0 -fsanitize=address"), libheif latest versions leak. It does not unregister its plugins. I reported a bug to them, no answer so far. I will see if I can provide a PR.
Knowing the fact that version 1.4.0 is affected by CVE-2019-11471 I'd recommend to put the minimum version to 1.5.0. In the case that a precompiler version check for that struct member cannot be used then it would be 1.7.0. Regarding HDR to 8 bit conversion my best idea is to just bail out with versions below 1.7.0.
Activity
vapier commentedon Aug 20, 2021
can you post a build snippet of the failure you're seeing & the version you're using ? then maybe @YakoYakoYokuYoku can take a look.
YakoYakoYokuYoku commentedon Aug 20, 2021
I can't replicate on my system, I've built and run (
2.3.2andmaster) with both CMake and Autotools the project with the test suite while using the latest release of HEIF.pierrejoye commentedon Aug 21, 2021
Hi :)
Ubuntu 20.04 LTS
bullseye/sid
libheif1/focal 1.6.1-1build1 amd64
CI: https://github.com/libgd/libgd/runs/3382353339?check_suite_focus=true
convert_hdr_to_8bit is only available from 1.7 upwards, which is not available widely yet in the distributions.
In any case, whether we support <1.7 or not, we should add checks, in CMake to disable it all if no suitable version has been found, or also in the code if we like to support <1.7.
pierrejoye commentedon Aug 21, 2021
Sidenote, if you use SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -O0 -fsanitize=address"), libheif latest versions leak. It does not unregister its plugins. I reported a bug to them, no answer so far. I will see if I can provide a PR.
YakoYakoYokuYoku commentedon Aug 21, 2021
Knowing the fact that version
1.4.0is affected byCVE-2019-11471I'd recommend to put the minimum version to1.5.0. In the case that a precompiler version check for that struct member cannot be used then it would be1.7.0. Regarding HDR to 8 bit conversion my best idea is to just bail out with versions below1.7.0.pierrejoye commentedon Aug 21, 2021
@YakoYakoYokuYoku Thanks :)
do I understand correctly that you are ok to require 1.7 or later? If <1.7 we disable HEIF codec, correct?
vapier commentedon Aug 21, 2021
if the user has explicitly requested heif support, we should fail the build if the needed versions weren't found, not just warn+disable.
afaik, no version of Debian or Ubuntu includes libheif. not sure where GH containers are getting this.
so if no distros are shipping it, requiring 1.7.0+ sounds fine to me. that was released almost 2 years ago at this point.
pierrejoye commentedon Aug 21, 2021
pierrejoye commentedon Aug 21, 2021
YakoYakoYokuYoku commentedon Aug 21, 2021
I'd go by putting a hard requirement on
1.7.0and later, as it wouldn't involve a compile or runtime check.Also there are packages for libheif for both Debian and Ubuntu:
vapier commentedon Aug 21, 2021
oh, i typod the package name in the search. oddly i typed it multiple times, but maybe my keyboard is being squishy when i press "i".
Debian bullseye is going to stable now and includes 1.11.0.
the latest Ubuntu LTS has 1.6, but all newer distros have 1.8+.
i''m fine requiring 1.7+ if it makes our lives easier. we're cutting new gd releases now.