Compilation fails when linking against a libpng without the apng patch set applied.
Would it be possible to detect this at compile-time and disable APNG support if libpng does not support it either?
FAILED: Lagom/Userland/Libraries/LibGfx/CMakeFiles/LibGfx.dir/ImageFormats/PNGLoader.cpp.o
/usr/bin/c++ -DENABLE_COMPILETIME_FORMAT_CHECK -DLibGfx_EXPORTS -I/tmp/ladybird -I/tmp/ladybird/Userland/Services -I/tmp/ladybird/Userland/Libraries -I/tmp/ladybird/Build/ladybird/Lagom -I/tmp/ladybird/Build/ladybird/Lagom/Userland/Services -I/tmp/ladybird/Build/ladybird/Lagom/Userland/Libraries -I/tmp/ladybird/Meta/Lagom/../.. -I/tmp/ladybird/Meta/Lagom/../../Userland -I/tmp/ladybird/Meta/Lagom/../../Userland/Libraries -I/tmp/ladybird/Meta/Lagom/../../Userland/Services -I/tmp/ladybird/Build/ladybird -O2 -pipe -march=armv8-a+crc+crypto -mtune=cortex-a72.cortex-a53 -mabi=lp64 -fstack-protector-strong -mharden-sls=all -std=c++23 -fPIC -fdiagnostics-color=always -Wall -Wextra -fno-exceptions -ffp-contract=off -Wno-invalid-offsetof -Wno-unknown-warning-option -Wno-unused-command-line-argument -Werror -Wno-expansion-to-defined -Wno-literal-suffix -Wno-dangling-reference -fno-semantic-interposition -fvisibility-inlines-hidden -Wno-maybe-uninitialized -Wno-shorten-64-to-32 -fsigned-char -ggnu-pubnames -fPIC -D_FILE_OFFSET_BITS=64 -O2 -g1 -MD -MT Lagom/Userland/Libraries/LibGfx/CMakeFiles/LibGfx.dir/ImageFormats/PNGLoader.cpp.o -MF Lagom/Userland/Libraries/LibGfx/CMakeFiles/LibGfx.dir/ImageFormats/PNGLoader.cpp.o.d -o Lagom/Userland/Libraries/LibGfx/CMakeFiles/LibGfx.dir/ImageFormats/PNGLoader.cpp.o -c /tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp: In function ‘AK::ErrorOr<AK::NonnullRefPtr<Gfx::Bitmap> > Gfx::render_animation_frame(const AnimationFrame&, const AnimationFrame&, const Bitmap&)’:
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:210:10: error: ‘PNG_DISPOSE_OP_BACKGROUND’ was not declared in this scope
210 | case PNG_DISPOSE_OP_BACKGROUND:
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:213:10: error: ‘PNG_DISPOSE_OP_PREVIOUS’ was not declared in this scope
213 | case PNG_DISPOSE_OP_PREVIOUS:
| ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:220:10: error: ‘PNG_BLEND_OP_SOURCE’ was not declared in this scope
220 | case PNG_BLEND_OP_SOURCE:
| ^~~~~~~~~~~~~~~~~~~
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:223:10: error: ‘PNG_BLEND_OP_OVER’ was not declared in this scope
223 | case PNG_BLEND_OP_OVER:
| ^~~~~~~~~~~~~~~~~
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp: In member function ‘AK::ErrorOr<long unsigned int, AK::Error> Gfx::PNGLoadingContext::read_frames(png_structp, png_infop)’:
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:234:9: error: ‘png_get_acTL’ was not declared in this scope; did you mean ‘png_get_sCAL’?
234 | if (png_get_acTL(png_ptr, info_ptr, &frame_count, &loop_count)) {
| ^~~~~~~~~~~~
| png_get_sCAL
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:237:9: error: ‘png_set_acTL’ was not declared in this scope; did you mean ‘png_set_sCAL’?
237 | png_set_acTL(png_ptr, info_ptr, frame_count, loop_count);
| ^~~~~~~~~~~~
| png_set_sCAL
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:240:13: error: ‘png_read_frame_head’ was not declared in this scope
240 | png_read_frame_head(png_ptr, info_ptr);
| ^~~~~~~~~~~~~~~~~~~
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:250:51: error: ‘PNG_INFO_fcTL’ was not declared in this scope; did you mean ‘PNG_INFO_pCAL’?
250 | if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_fcTL)) {
| ^~~~~~~~~~~~~
| PNG_INFO_pCAL
/tmp/ladybird/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:254:13: error: ‘png_get_next_frame_fcTL’ was not declared in this scope
254 | png_get_next_frame_fcTL(png_ptr, info_ptr, &width, &height, &x, &y, &delay_num, &delay_den, &dispose_op, &blend_op);
| ^~~~~~~~~~~~~~~~~~~~~~~
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too