<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>478987</bug_id>
          
          <creation_ts>2023-12-25 08:28:27 +0000</creation_ts>
          <short_desc>Fails to build against libjxl 0.9</short_desc>
          <delta_ts>2024-01-28 10:14:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>General</component>
          <version>5.2.2</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christoph Reiter">reiter.christoph</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/021389637e50638b096c7227cf5c06e6444cef89</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2276408</commentid>
    <comment_count>0</comment_count>
    <who name="Christoph Reiter">reiter.christoph</who>
    <bug_when>2023-12-25 08:28:27 +0000</bug_when>
    <thetext>The last libjxl release removed some deprecated things and changed API/ABI in some places: https://github.com/libjxl/libjxl/releases/tag/v0.9.0

The build currently fails like this (there might be more issues):

-----
C:/msys64/home/user/M/mingw-w64-krita/src/krita-5.2.2/plugins/impex/jxl/JPEGXLImport.cpp:513:20: error: no matching function for call to &apos;JxlDecoderGetColorAsEncodedProfile&apos;
  513 |                 == JxlDecoderGetColorAsEncodedProfile(dec.get(),
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/jxl/decode.h:749:29: note: candidate function not viable: requires 3 arguments, but 4 were provided
  749 | JXL_EXPORT JxlDecoderStatus JxlDecoderGetColorAsEncodedProfile(
      |                             ^
  750 |     const JxlDecoder* dec, JxlColorProfileTarget target,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  751 |     JxlColorEncoding* color_encoding);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/user/M/mingw-w64-krita/src/krita-5.2.2/plugins/impex/jxl/JPEGXLImport.cpp:638:24: error: no matching function for call to &apos;JxlDecoderGetICCProfileSize&apos;
  638 |                     != JxlDecoderGetICCProfileSize(dec.get(), nullptr, JXL_COLOR_PROFILE_TARGET_DATA, &amp;iccSize)) {
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/jxl/decode.h:775:29: note: candidate function not viable: requires 3 arguments, but 4 were provided
  775 | JXL_EXPORT JxlDecoderStatus JxlDecoderGetICCProfileSize(
      |                             ^
  776 |     const JxlDecoder* dec, JxlColorProfileTarget target, size_t* size);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/user/M/mingw-w64-krita/src/krita-5.2.2/plugins/impex/jxl/JPEGXLImport.cpp:645:24: error: no matching function for call to &apos;JxlDecoderGetColorAsICCProfile&apos;
  645 |                     != JxlDecoderGetColorAsICCProfile(dec.get(),
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/jxl/decode.h:793:29: note: candidate function not viable: requires 4 arguments, but 5 were provided
  793 | JXL_EXPORT JxlDecoderStatus JxlDecoderGetColorAsICCProfile(
      |                             ^
  794 |     const JxlDecoder* dec, JxlColorProfileTarget target, uint8_t* icc_profile,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  795 |     size_t size);
      |     ~~~~~~~~~~~
C:/msys64/home/user/M/mingw-w64-krita/src/krita-5.2.2/plugins/impex/jxl/JPEGXLImport.cpp:659:28: error: no matching function for call to &apos;JxlDecoderGetICCProfileSize&apos;
  659 |                         != JxlDecoderGetICCProfileSize(dec.get(),
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/jxl/decode.h:775:29: note: candidate function not viable: requires 3 arguments, but 4 were provided
  775 | JXL_EXPORT JxlDecoderStatus JxlDecoderGetICCProfileSize(
      |                             ^
  776 |     const JxlDecoder* dec, JxlColorProfileTarget target, size_t* size);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/user/M/mingw-w64-krita/src/krita-5.2.2/plugins/impex/jxl/JPEGXLImport.cpp:669:28: error: no matching function for call to &apos;JxlDecoderGetColorAsICCProfile&apos;
  669 |                         != JxlDecoderGetColorAsICCProfile(dec.get(),
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/jxl/decode.h:793:29: note: candidate function not viable: requires 4 arguments, but 5 were provided
  793 | JXL_EXPORT JxlDecoderStatus JxlDecoderGetColorAsICCProfile(
      |                             ^
  794 |     const JxlDecoder* dec, JxlColorProfileTarget target, uint8_t* icc_profile,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  795 |     size_t size);
      |     ~~~~~~~~~~~
5 errors generated.
-----

Here is how other projects deal with the API differences, as an example: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/970/diffs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2277088</commentid>
    <comment_count>1</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2023-12-29 10:40:53 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2040</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2278294</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2024-01-05 14:04:53 +0000</bug_when>
    <thetext>Git commit ace7edcca6ad322581ab39620f21ccf3ffbd3b5a by Dmitry Kazakov, on behalf of Timo Gurr.
Committed on 05/01/2024 at 15:04.
Pushed by dkazakov into branch &apos;master&apos;.

Fix build with libjxl 0.9.0

Fix build with libjxl 0.9.0

Test Plan
---------

* Upgrade to libjxl 0.9.0
* Apply patch from MR and build krita (5.2.2)
* Open/Display a sample image e.g. https://jpegxl.info/test-page/red-room.jxl

Formalities Checklist
--------------------- 

- [x] I confirmed this builds.
- [x] I confirmed Krita ran and the relevant functions work (Could successfully open/display a sample image https://jpegxl.info/test-page/red-room.jxl).
- [ ] I tested the relevant unit tests and can confirm they are not broken. (If not possible, don&apos;t hesitate to ask for help!)
- [x] I made sure my commits build individually and have good descriptions as per [KDE guidelines](https://community.kde.org/Policies/Commit_Policy).
- [x] I made sure my code conforms to the standards set in the HACKING file.
- [x] I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per [KDE Licensing Policy](https://community.kde.org/Policies/Licensing_Policy).

_**Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build.**_
_**If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.**_

M  +14   -1    plugins/impex/jxl/JPEGXLImport.cpp

https://invent.kde.org/graphics/krita/-/commit/ace7edcca6ad322581ab39620f21ccf3ffbd3b5a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2283778</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2024-01-28 10:14:47 +0000</bug_when>
    <thetext>Git commit 021389637e50638b096c7227cf5c06e6444cef89 by Dmitry Kazakov, on behalf of Timo Gurr.
Committed on 28/01/2024 at 10:13.
Pushed by dkazakov into branch &apos;krita/5.2&apos;.

Fix build with libjxl 0.9.0

Fix build with libjxl 0.9.0

Test Plan
---------

* Upgrade to libjxl 0.9.0
* Apply patch from MR and build krita (5.2.2)
* Open/Display a sample image e.g. https://jpegxl.info/test-page/red-room.jxl

Formalities Checklist
--------------------- 

- [x] I confirmed this builds.
- [x] I confirmed Krita ran and the relevant functions work (Could successfully open/display a sample image https://jpegxl.info/test-page/red-room.jxl).
- [ ] I tested the relevant unit tests and can confirm they are not broken. (If not possible, don&apos;t hesitate to ask for help!)
- [x] I made sure my commits build individually and have good descriptions as per [KDE guidelines](https://community.kde.org/Policies/Commit_Policy).
- [x] I made sure my code conforms to the standards set in the HACKING file.
- [x] I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per [KDE Licensing Policy](https://community.kde.org/Policies/Licensing_Policy).

_**Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build.**_
_**If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.**_

M  +14   -1    plugins/impex/jxl/JPEGXLImport.cpp

https://invent.kde.org/graphics/krita/-/commit/021389637e50638b096c7227cf5c06e6444cef89</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>