CR3 metadata decoding test of feature branch on Linux

I can use metadata-exiv2 branch to decode CR3 metadata. The branch is old (May 2021). I would like to try and update metadata-exiv2 branch to include commits from current dev.

There is a metadata-exiv2 branch in #5889. The idea is to use exiv2 in RT. There is a corresponding issue report CR3 metadata decoding support · Issue #6248 · Beep6581/RawTherapee · GitHub. This is labeled v6.0 milestone.

I tried the metadata-exiv2 branch. It works for me with patch proposed by @feuerrot in rtengine/imagedata.cc and exiv2 upgraded to v0.27.5 with -DEXIV2_ENABLE_BMFF=On. I can now see and use:

  • metadata in main editor window
  • Color tab | color management | auto-matched camera profile is selectable
  • Transform Tab | Profiled Lens correction | automatically selected seems to work and picks up camera and lens.

metadata-exiv2 branch is old (May 2021). This branch is 15 commits ahead, 255 commits behind dev. Exiv2 support is a main change. It can stay in the feature branch, but I would like to try and update metadata-exiv2 branch to include commits from current dev.

This is what I did (long, but simple in principle) on Debian stable 11.3:
Build exiv2 v0.27.5 with -DEXIV2_ENABLE_BMFF=On

mkdir ${HOME}/test/rt_exiv2
cd ${HOME}/test/rt_exiv2

git clone https://github.com/Exiv2/exiv2.git
cd exiv2
git checkout v0.27.5
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=On -DCMAKE_INSTALL_PREFIX="$HOME/test/rt_exiv2" ..
make --build . -j8
cmake --install . 

Make sure RT find local exiv2 library and not system version. I put this into a file rt_definitions.sh

RT_PREFIX=${HOME}/test/rt_exiv2

# Used to find programs/tools during build
export PATH="${RT_PREFIX}/bin:$PATH"

# Used to detect the build dependencies
export PKG_CONFIG_PATH="${RT_PREFIX}/share/pkgconfig:${RT_PREFIX}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

# Used to find the glib-introspection dependencies
export XDG_DATA_DIRS="${XDG_DATA_DIRS:+$XDG_DATA_DIRS:}${RT_PREFIX}/share:/usr/local/share:/usr/share"

# Used to find the libraries at runtime
export LD_LIBRARY_PATH="${RT_PREFIX}/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

arch="$(dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null)"
export PKG_CONFIG_PATH="${RT_PREFIX}/lib/${arch}/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${RT_PREFIX}/lib/${arch}:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

Source definitions:

source rt_definitions.sh

Get RT metadata-exiv2 branch:

cd ${HOME}/test/rt_exiv2

git clone https://github.com/Beep6581/RawTherapee.git

cd RawTherapee

git checkout --track  origin/metadata-exiv2

Patch rtengine/imagedata.cc. Add one line Exiv2::enableBMFF(true);

Exiv2::Image::AutoPtr open_exiv2(const Glib::ustring& fname)
{
/// Patch to enable BMFF
Exiv2::enableBMFF(true);
/// End of patch
#ifdef EXV_UNICODE_PATH
    glong ws_size = 0;
    gunichar2* const ws = g_utf8_to_utf16(fname.c_str(), -1, nullptr, &ws_size, nullptr);
    std::wstring wfname;
    wfname.reserve(ws_size);
    for (glong i = 0; i < ws_size; ++i) {
        wfname.push_back(ws[i]);
    }
    g_free(ws);
    auto image = Exiv2::ImageFactory::open(wfname);
#else
    auto image = Exiv2::ImageFactory::open(fname);
#endif
    return image;
}

Build RT:

cd ${HOME}/test/rt_exiv2/RawTherapee
mkdir build
cd build

cmake \
    -DCMAKE_BUILD_TYPE="release"  \
    -DCACHE_NAME_SUFFIX="5-dev" \
    -DPROC_TARGET_NUMBER="2" \
    -DBUILD_BUNDLE="ON" \
    -DBUNDLE_BASE_INSTALL_DIR="$HOME/test/rt_exiv2/install" \
    -DOPTION_OMP="ON" \
    -DWITH_LTO="OFF" \
    -DWITH_PROF="OFF" \
    -DWITH_SAN="OFF" \
    -DWITH_SYSTEM_KLT="OFF" \
    ..

make -j8

make install

I can now run the feature branch and decode CR3 metadata (I have to make sure I have executed source rt_definitions.sh in the console I use):

cd ${HOME}/test/rt_exiv2/install
./RawTherapee

This is great fun, but there are many needed commits in dev which we need to merge to get a useful RT.

Since metadata-exiv2 branch 15 commits ahead, 255 commits behind It is a hard job to merge into dev:

This is what git merge metadata-exiv2 results in when merging into current dev (after committing small Exiv2::enableBMFF(true); patch to metadata-exiv2:

cd ${HOME}/test/rt_exiv2/RawTherapee
git checkout dev
git merge metadata-exiv2 

Removing tools/generateRtexifUpdates
Auto-merging rtgui/thumbnail.h
CONFLICT (content): Merge conflict in rtgui/thumbnail.h
Auto-merging rtgui/thumbnail.cc
Auto-merging rtgui/filmnegative.cc
Auto-merging rtgui/editwidgets.h
Auto-merging rtgui/editwidgets.cc
Auto-merging rtgui/editorpanel.cc
CONFLICT (content): Merge conflict in rtgui/editorpanel.cc
Auto-merging rtgui/controlspotpanel.cc
Auto-merging rtgui/controllines.h
Auto-merging rtgui/controllines.cc
Auto-merging rtgui/CMakeLists.txt
Removing rtexif/stdattribs.cc
Removing rtexif/sonyminoltaattribs.cc
CONFLICT (modify/delete): rtexif/rtexif.h deleted in metadata-exiv2 and modified in HEAD. Version HEAD of rtexif/rtexif.h left in tree.
CONFLICT (modify/delete): rtexif/rtexif.cc deleted in metadata-exiv2 and modified in HEAD. Version HEAD of rtexif/rtexif.cc left in tree.
Removing rtexif/pentaxattribs.cc
Removing rtexif/panasonicattribs.cc
CONFLICT (modify/delete): rtexif/olympusattribs.cc deleted in metadata-exiv2 and modified in HEAD. Version HEAD of rtexif/olympusattribs.cc left in tree.
Removing rtexif/nikonattribs.cc
Removing rtexif/kodakattribs.cc
Removing rtexif/fujiattribs.cc
Removing rtexif/canonattribs.cc
Removing rtexif/CMakeLists.txt
Auto-merging rtengine/simpleprocess.cc
Auto-merging rtengine/rtthumbnail.cc
CONFLICT (content): Merge conflict in rtengine/rtthumbnail.cc
Auto-merging rtengine/rtengine.h
Removing rtengine/rawmetadatalocation.h
Auto-merging rtengine/rawimagesource.cc
Auto-merging rtengine/procparams.h
Auto-merging rtengine/procparams.cc
Removing rtengine/iptcpairs.h
Auto-merging rtengine/iplocallab.cc
Auto-merging rtengine/improcfun.h
Auto-merging rtengine/improcfun.cc
Auto-merging rtengine/improccoordinator.cc
Auto-merging rtengine/imagesource.h
CONFLICT (content): Merge conflict in rtengine/imagesource.h
Auto-merging rtengine/imageio.h
Auto-merging rtengine/imageio.cc
CONFLICT (content): Merge conflict in rtengine/imageio.cc
Auto-merging rtengine/imagedata.cc
CONFLICT (content): Merge conflict in rtengine/imagedata.cc
Auto-merging rtengine/dfmanager.cc
Auto-merging rtengine/dcrop.cc
Auto-merging rtengine/dcp.h
Auto-merging rtengine/dcp.cc
Auto-merging rtengine/CMakeLists.txt
Auto-merging CMakeLists.txt

I tried to resolve merge conflicts (content) and keep files deleted in metadata-exiv2 (modify/delete). Then I got:

[  1%] Building CXX object rtengine/CMakeFiles/rtengine.dir/dcp.cc.o
/home/magnus/test/rt_exiv2/RawTherapee/rtengine/dcp.cc: In constructor ‘rtengine::DCPProfile::DCPProfile(const Glib::ustring&)’:
/home/magnus/test/rt_exiv2/RawTherapee/rtengine/dcp.cc:1121:54: error: no matching function for call to ‘fopen(const char*, const char [3])’
 1121 |     FILE* const file = g_fopen(filename.c_str(), "rb");

But rtengine/dcp.cc was auto-merged.

It was a nice try! I ended up breaking something fundamental since RT code has many existing references to g_fopen(filename.c_str(), "rb").

How to fix this to get metadata-exiv2 branch to include current dev commits? It would be a lovely hack. I have tried, but not yet succeed. What do you think?

Hi Magnus,

See #6324. Certain functions had to be moved into the rtengine:: namespace. When you inspect the original change you’ll find places where g_fopen() must be called in the global namespace. I guess that’s the same here. So try to prepend g_fopen() with :: (i.e. FILE* const file = ::g_fopen(...);).

BTW: The right way would be to merge dev into metadata-exiv2, so we can keep the latter (updated) until it is ready to be merged into dev.

HTH,
Flössie

1 Like

@floessie, Thank you for the feedback. I will check and try your sugestions.

Yes, I agree completely, any uptates should stay in exiv2 branch. I see now, that locally, I did the other way around.

IMO, rather than merge in, I’d suggest rebasing the metadata-exiv2 branch and fixing whatever conflicts occur so it’s easier to keep track of which commits are specific to exiv2

Unfortunately, the longer you go without rebasing, the harder it gets! :frowning:

It would be somehting like
git checkout metadata-exiv2
git rebase -i dev
lots of pain and suffering as you fix all the conflicts

Merge works for me. I managed to merge metadata-exiv2 branch into my updated dev. I can start RT and create output. CR3 metadata is available in editor. I have not done any regression testing at this stage.

@floessie, the ::g_fopen(...); proposal was key + checking some details of what was going on in #5889. I have to redo it, to recheck and confirm. I did some conflict resolution based on intuition.

@Entropy512, Next step is to try your suggestion and rebase. I will also stay in metadata-exiv2 branch as @floessie suggests.

Finally, If I reach this point, what is the way forward once I have a locally updated metadata-exiv2 branch. How to make my changes available for review and testing? What is the best procedure?

There are – as always – pros and cons to rebasing rather than merging, but if I look at the history of the branch (and RT) we favor merging over rebasing.

This should be answered by @Morgan_Hardwood or @Thanatomanic. But if I were you, I’d fork RT on GitHub, checkout metadata-exiv2 in your fork, create a metadata-exiv2-update branch, merge in dev, and create a pull request against our metadata-exiv2. IIRC, GitHub has a howto on this topic that’ll get you started.

Good luck and thanks for your contribution,
Flössie

@floessie, I did all the steps besides create a pull request. I have forked RT on GitHub, checked out metadata-exiv2 in my fork and created a metadata-exiv2-update branch, where I have merged in dev.

I can create a pull request, but I deliberately did not do it. I thought my fork needed some stand alone testing first. However I do not mind executing the pull request against RT metadata-exiv2 branch, if that is the best way forward.

The fork is here: GitHub - KarlMagnusLarsson/RawTherapee: A powerful cross-platform raw photo processing program

The fork has a branch metadata-exiv2-update which contains current RT dev + metadata-exiv2.

The metadata-exiv2-update branch requires exiv2 upgraded to v0.27.5 with -DEXIV2_ENABLE_BMFF=On.

I do not get exiv2 v0.27.5 with -DEXIV2_ENABLE_BMFF=On in Debian stable 11.3 => I have to build it.

mkdir ${HOME}/test/rt_exiv2
cd ${HOME}/test/rt_exiv2

git clone https://github.com/Exiv2/exiv2.git
cd exiv2
git checkout v0.27.5
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=On -DCMAKE_INSTALL_PREFIX="$HOME/test/rt_exiv2" ..
make --build . -j8
cmake --install . 

Make sure RT find local exiv2 library and not system version. I put this into a file rt_definitions.sh

RT_PREFIX=${HOME}/test/rt_exiv2

# Used to find programs/tools during build
export PATH="${RT_PREFIX}/bin:$PATH"

# Used to detect the build dependencies
export PKG_CONFIG_PATH="${RT_PREFIX}/share/pkgconfig:${RT_PREFIX}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

# Used to find the glib-introspection dependencies
export XDG_DATA_DIRS="${XDG_DATA_DIRS:+$XDG_DATA_DIRS:}${RT_PREFIX}/share:/usr/local/share:/usr/share"

# Used to find the libraries at runtime
export LD_LIBRARY_PATH="${RT_PREFIX}/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

arch="$(dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null)"
export PKG_CONFIG_PATH="${RT_PREFIX}/lib/${arch}/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${RT_PREFIX}/lib/${arch}:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

Source definitions:

source rt_definitions.sh

Get RT metadata-exiv2-update branch:

cd ${HOME}/test/rt_exiv2

git clone https://github.com/KarlMagnusLarsson/RawTherapee

cd RawTherapee

git checkout --track  origin/metadata-exiv2-update

Build RT:

cd ${HOME}/test/rt_exiv2/RawTherapee
mkdir build
cd build

cmake \
    -DCMAKE_BUILD_TYPE="release"  \
    -DCACHE_NAME_SUFFIX="5-dev" \
    -DPROC_TARGET_NUMBER="2" \
    -DBUILD_BUNDLE="ON" \
    -DBUNDLE_BASE_INSTALL_DIR="$HOME/test/rt_exiv2/install" \
    -DOPTION_OMP="ON" \
    -DWITH_LTO="OFF" \
    -DWITH_PROF="OFF" \
    -DWITH_SAN="OFF" \
    -DWITH_SYSTEM_KLT="OFF" \
    ..

make -j8

make install

I can now run the feature branch and decode CR3 metadata (I have to make sure I have executed source rt_definitions.sh in the console I use):

cd ${HOME}/test/rt_exiv2/install
./rawtherapee

@KarlMagnusLarsson Good work and documentation, Magnus! :+1:

Would you mind to integrate this little patch to enable compilation even if BMFF support isn’t available?

diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc
index cdc3b3b6f..5910f9ac5 100644
--- a/rtengine/imagedata.cc
+++ b/rtengine/imagedata.cc
@@ -41,9 +41,10 @@ extern const Settings *settings;
 
 Exiv2::Image::AutoPtr open_exiv2(const Glib::ustring& fname)
 {
-/// Patch to enable BMFF
-Exiv2::enableBMFF(true);
-/// End of patch
+#ifdef EXV_ENABLE_BMFF
+    Exiv2::enableBMFF(true);
+#endif
+
 #ifdef EXV_UNICODE_PATH
     glong ws_size = 0;
     gunichar2* const ws = g_utf8_to_utf16(fname.c_str(), -1, nullptr, &ws_size, nullptr);

This way it still builds fine on Debian Buster. Considering BMFF support: it’s already fixed in Testing.

HTH,
Flössie

@floessie, Thank you for the patch. Your patch is implemented in 59ba9f62b in https://github.com/KarlMagnusLarsson/RawTherapee/tree/metadata-exiv2-update, that is, in metadata-exiv2-update branch.

@jhmnieuwenhuis , I see a similar error in Linux as you point out in OSX:

The problem is that the output from my experimental fork GitHub - KarlMagnusLarsson/RawTherapee: A powerful cross-platform raw photo processing program branch metadata-exiv2-update does not embed color profile at all. A command like:

exiftool -icc_profile:* <picture-file>

Generates NO output. Nothing. Regardless of output color profile chosen in RT

The issue:
This problem affect the temporary file when pushing to external editor from RT main edit window, that is file sent to external editor after RT raw conversion has no embedded color profile. This also affect any regular output, that is files sent to the normal processing queue. There is no embedded color profile regardless of output color profile chosen in RT.

If I go back to RT main repo GitHub - Beep6581/RawTherapee: A powerful cross-platform raw photo processing program branch metadata-exiv2 and add the patch Exiv2::enableBMFF(true); to rtengine/imagedata.cc to make metadata visible. Then I am back to before my merge of latest dev branch.

xiv2::Image::AutoPtr open_exiv2(const Glib::ustring& fname)
{
#ifdef EXV_ENABLE_BMFF
    Exiv2::enableBMFF(true);
#endif

#ifdef EXV_UNICODE_PATH
    glong ws_size = 0;
    gunichar2* const ws = g_utf8_to_utf16(fname.c_str(), -1, nullptr, &ws_size, nullptr);
    std::wstring wfname;
    wfname.reserve(ws_size);
    for (glong i = 0; i < ws_size; ++i) {
        wfname.push_back(ws[i]);
    }
    g_free(ws);
    auto image = Exiv2::ImageFactory::open(wfname);
#else
    auto image = Exiv2::ImageFactory::open(fname);
#endif
    return image;
}

and if I then build the old branch metadata-exiv2+ small patch, then I get the same thing. No embedded color profile in RT output when pushing to external editor or when creating output using the regular queue.

  1. I think the error is in RT main repo GitHub - Beep6581/RawTherapee: A powerful cross-platform raw photo processing program branch metadata-exiv2, from the beginning. (It looks like it is not a result of my merging the metadata-exiv2 branch into dev to create metadata-exiv2-update).

  2. The current dev branch is fine in GitHub - Beep6581/RawTherapee: A powerful cross-platform raw photo processing program. The output files have embedded color profiles where the RT output color profile is respected, also for CR3 (but then there is no metadata)

The documentation to build the experimental fork metadata-exiv2-update branch is in thread history above and linked here: CR3 metadata decoding test of feature branch on Linux - #7 by KarlMagnusLarsson

What do you think? How to fix the missing color profile in output? I think it is somewhere in metadata-exiv2 branch in #5889. If the fault is found, then I will update my fork.

I am not a software developer but I am willing to test.

I will try and check the commits before and in metadata-exiv2 branch in main repo https://github.com/Beep6581/RawTherapee and see if I can find when the color profile disappears.

The old metadata-exiv2 branch in main repo does not include a color profile for any type of raw file. We have the same problem, no embedded color profile, in output, also for legacy CR2.

I have checked which commit removes the embedded color profile in output from RT in metadata-exiv2 branch of RT main repo Commits · Beep6581/RawTherapee · GitHub.

In the test I do not care about CR3 or libexiv version for CR3 metadata at all. I test with regular legacy Canon CR2 raw files. The issue is that all raw (also old CR2) files result in RT output produce output files without any embedded color profile using metadata-exiv2 branch.

cd {$HOME}/test/fork3
git clone https://github.com/Beep6581/RawTherapee.git
git checkout medatada-exiv2
cd RawTherapee
mkdir build
cd build
cmake \
    -DCMAKE_BUILD_TYPE="release"  \
    -DCACHE_NAME_SUFFIX="5-dev" \
    -DPROC_TARGET_NUMBER="2" \
    -DBUILD_BUNDLE="ON" \
    -DBUNDLE_BASE_INSTALL_DIR="$HOME/test/fork3/install" \
    -DOPTION_OMP="ON" \
    -DWITH_LTO="OFF" \
    -DWITH_PROF="OFF" \
    -DWITH_SAN="OFF" \
    -DWITH_SYSTEM_KLT="OFF" \
    ..
make -j8
make install
cd {$HOME}/test/fork3/install
./rawtherapee

The test:
I did git bisect. The test after each build was to check if RT output tiff files from legacy Canon CR2 raw had any embedded color profile, as selected by RT Color Tab | Output Profile | RTv4_Large. The output file was checked:

exiftool -icc_profile:* <filename>

If an embedded profile is missing then this command results in no output at all. If a profile is there, this (or similar) is stated:

Profile CMM Type                : Little CMS
Profile Version                 : 4.3.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2018:11:13 11:18:01
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : 
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Little CMS
Profile ID                      : 0
Profile Description             : RTv4_Large
Profile Copyright               : Copyright RawTherapee 2018, CC0
Media White Point               : 0.9642 1 0.82491
Chromatic Adaptation            : 0.99995 -3e-05 -3e-05 -5e-05 1.00005 -2e-05 -2e-05 2e-05 0.99974
Red Matrix Column               : 0.79771 0.28806 0
Blue Matrix Column              : 0.03133 8e-05 0.82489
Green Matrix Column             : 0.13516 0.71187 2e-05
Red Tone Reproduction Curve     : (Binary data 40 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 40 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 40 bytes, use -b option to extract)
Chromaticity Channels           : 3
Chromaticity Colorant           : Unknown (0)
Chromaticity Channel 1          : 0.7347 0.2653
Chromaticity Channel 2          : 0.15961 0.84039
Chromaticity Channel 3          : 0.03661 0.00011
Device Mfg Desc                 : RawTherapee

Git bisect gave me this:

c360fd7e2c2a1de0e318d185533f9789dc84a9c4 is the first bad commit
commit c360fd7e2c2a1de0e318d185533f9789dc84a9c4
Author: Alberto Griggio <agriggio@users.noreply.github.com>
Date:   Mon May 6 09:27:44 2019 +0200

    Use exiv2 for metadata handling

 .gitignore                     |    1 -
 CMakeLists.txt                 |   23 +-
 clean.bat                      |    4 -
 rtengine/CMakeLists.txt        |    6 +-
 rtengine/dcp.cc                |  437 ++++-
 rtengine/dfmanager.cc          |    2 +-
 rtengine/dynamicprofile.cc     |    2 +-
 rtengine/ffmanager.cc          |    2 +-
 rtengine/histmatching.cc       |    6 +-
 rtengine/imagedata.cc          | 1481 +++++------------
 rtengine/imagedata.h           |  110 +-
 rtengine/imageio.cc            |  434 +----
 rtengine/imageio.h             |   30 +-
 rtengine/improccoordinator.cc  |   21 +-
 rtengine/improcfun.cc          |    5 +-
 rtengine/iptcpairs.h           |   49 -
 rtengine/previewimage.cc       |    3 +-
 rtengine/procparams.cc         |   69 +-
 rtengine/procparams.h          |   86 +-
 rtengine/rawimagesource.cc     |    3 +-
 rtengine/rawmetadatalocation.h |   41 -
 rtengine/rtengine.h            |   73 +-
 rtengine/rtthumbnail.cc        |   57 +-
 rtengine/rtthumbnail.h         |    6 +-
 rtengine/simpleprocess.cc      |   23 +-
 rtexif/CMakeLists.txt          |   17 -
 rtexif/canonattribs.cc         | 2078 ------------------------
 rtexif/fujiattribs.cc          |  316 ----
 rtexif/kodakattribs.cc         |  165 --
 rtexif/nikonattribs.cc         | 1271 ---------------
 rtexif/olympusattribs.cc       |  846 ----------
 rtexif/panasonicattribs.cc     |  142 --
 rtexif/pentaxattribs.cc        | 2219 -------------------------
 rtexif/rtexif.cc               | 3488 ----------------------------------------
 rtexif/rtexif.h                |  690 --------
 rtexif/sonyminoltaattribs.cc   | 2640 ------------------------------
 rtexif/stdattribs.cc           |  931 -----------
 rtgui/CMakeLists.txt           |    2 +-
 rtgui/cacheimagedata.cc        |    4 -
 rtgui/cacheimagedata.h         |   42 +-
 rtgui/editorpanel.cc           |   14 +-
 rtgui/exifpanel.cc             |  557 ++-----
 rtgui/exifpanel.h              |   56 +-
 rtgui/iptcpanel.cc             |  140 +-
 rtgui/resize.cc                |    1 +
 rtgui/shcselector.cc           |    1 +
 rtgui/thumbnail.cc             |  111 +-
 rtgui/thumbnail.h              |    2 +-
 tools/generateRtexifUpdates    |   92 --
 49 files changed, 1324 insertions(+), 17475 deletions(-)
 delete mode 100644 rtengine/iptcpairs.h
 delete mode 100644 rtengine/rawmetadatalocation.h
 delete mode 100644 rtexif/CMakeLists.txt
 delete mode 100644 rtexif/canonattribs.cc
 delete mode 100644 rtexif/fujiattribs.cc
 delete mode 100644 rtexif/kodakattribs.cc
 delete mode 100644 rtexif/nikonattribs.cc
 delete mode 100644 rtexif/olympusattribs.cc
 delete mode 100644 rtexif/panasonicattribs.cc
 delete mode 100644 rtexif/pentaxattribs.cc
 delete mode 100644 rtexif/rtexif.cc
 delete mode 100644 rtexif/rtexif.h
 delete mode 100644 rtexif/sonyminoltaattribs.cc
 delete mode 100644 rtexif/stdattribs.cc
 delete mode 100755 tools/generateRtexifUpdates
magnus@debian:~/test/fork3/RawTherapee$ 

The commit c360fd7e2c2a does introduce the error. This is the very first commit in metadata-exiv2 branch of RT main repo: https://github.com/Beep6581/RawTherapee/pull/5889/commits

The commit before a2e2ace1c, works fine and produce embedded color profile in output tiff from raw processed by RT.

The next step is to analyze what change in c360fd7e2c2a cause the embedded color profile to disappear. Edit: or it is not yet implemented in this branch and has to be added.

Any suggestion, help and insight is very much appreciated.

Excellent job!