Bug 501213

Summary: heif version requirement needs to be updated in CMakeLists.txt
Product: [Frameworks and Libraries] frameworks-kimageformats Reporter: Schrijvers Luc <begasus>
Component: generalAssignee: Alex Merry <alex.merry>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, kdelibs-bugs-null, mircomir
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Schrijvers Luc 2025-03-08 06:21:45 UTC
SUMMARY

Build failure on kimageformats 6.12.0-re1 and heif 1.12.0

STEPS TO REPRODUCE
1. Build the framework kimageformats
2. build will fail with heif version 1.12.0 (requirement in kimageformats mention 1.10.0)

OBSERVED RESULT

Build fails with an error:

```
[ 91%] Built target kimg_psd
/sources/kimageformats-v6.12.0-rc1/src/imageformats/heif.cpp: In member function 'bool HEIFHandler::write_helper(const QImage&)':
/sources/kimageformats-v6.12.0-rc1/src/imageformats/heif.cpp:333:94: error: 'heif_metadata_compression_off' was not declared in this scope
  333 |             err = heif_context_add_XMP_metadata2(context, handle, ba.constData(), ba.size(), heif_metadata_compression_off);
      |                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/sources/kimageformats-v6.12.0-rc1/src/imageformats/heif.cpp:333:19: error: 'heif_context_add_XMP_metadata2' was not declared in this scope; did you mean 'heif_context_add_XMP_metadata'?
  333 |             err = heif_context_add_XMP_metadata2(context, handle, ba.constData(), ba.size(), heif_metadata_compression_off);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   heif_context_add_XMP_metadata
```

EXPECTED RESULT

Build completes.

SOFTWARE/OS VERSIONS
Haiku: R1B5
KDE Frameworks Version: 6.12.0-rc1 (was still OK with 6.11.0)
Qt Version: 6.8.2

ADDITIONAL INFORMATION

Build completed fine after updating local package for heif to 1.19.7
Comment 1 Albert Astals Cid 2025-03-08 23:45:00 UTC
Mirco, we need to increase the heif requirement to 1.14 in CMaKeLists (i think it's when heif_context_add_XMP_metadata2 was introduced) or add some version checks.

I'll leave it up to you.
Comment 2 Bug Janitor Service 2025-03-09 09:46:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/347