[krita] plugins/impex/exr: Add a hidden config option to set the default exr F16/F32 profile

Boudewijn Rempt null at kde.org
Wed May 1 14:41:39 BST 2019


Git commit 342b87f3a50947e0f90cb822c40b7e0dfc966cc2 by Boudewijn Rempt.
Committed on 01/05/2019 at 13:40.
Pushed by rempt into branch 'master'.

Add a hidden config option to set the default exr F16/F32 profile

Exr files don't have profiles, and profiles are totally irrelevant
for exr/hdr workflow: the lut docker is what is used in these cases.
But since we need to set a profile on a krita image, let's make it
configurable at least.

Note: there's no gui for this because a) it's an advanced option
and b) we're in string freeze.

CCMAIL:kimageshop at kde.org
BUG:406939

M  +4    -2    plugins/impex/exr/exr_converter.cc

https://invent.kde.org/kde/krita/commit/342b87f3a50947e0f90cb822c40b7e0dfc966cc2

diff --git a/plugins/impex/exr/exr_converter.cc b/plugins/impex/exr/exr_converter.cc
index fe56f6a2a3..7bcdd2cca7 100644
--- a/plugins/impex/exr/exr_converter.cc
+++ b/plugins/impex/exr/exr_converter.cc
@@ -197,11 +197,13 @@ ImageType imfTypeToKisType(Imf::PixelType type)
 
 const KoColorSpace* kisTypeToColorSpace(QString model, ImageType imageType)
 {
+    const QString profileName = KisConfig(false).readEntry("ExrDefaultColorProfile", KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(model));
+
     switch (imageType) {
     case IT_FLOAT16:
-        return KoColorSpaceRegistry::instance()->colorSpace(model, Float16BitsColorDepthID.id(), "");
+        return KoColorSpaceRegistry::instance()->colorSpace(model, Float16BitsColorDepthID.id(), profileName);
     case IT_FLOAT32:
-        return KoColorSpaceRegistry::instance()->colorSpace(model, Float32BitsColorDepthID.id(), "");
+        return KoColorSpaceRegistry::instance()->colorSpace(model, Float32BitsColorDepthID.id(), profileName);
     case IT_UNKNOWN:
     case IT_UNSUPPORTED:
         return 0;


More information about the kimageshop mailing list