[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.9] krita/plugins/formats/exr: Better check for top-level channel name
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2015-09-21 10:25:18
Message-ID: E1ZdyHe-0003Gb-M3 () scm ! kde ! org
[Download RAW message or body]

Git commit d60d221650d139f8cc9941722711b6310d0c3bb4 by Boudewijn Rempt.
Committed on 21/09/2015 at 10:24.
Pushed by rempt into branch 'calligra/2.9'.

Better check for top-level channel name

It fits the apidox now.

CCBUG:352734

M  +7    -2    krita/plugins/formats/exr/exr_converter.cc

http://commits.kde.org/calligra/d60d221650d139f8cc9941722711b6310d0c3bb4

diff --git a/krita/plugins/formats/exr/exr_converter.cc \
b/krita/plugins/formats/exr/exr_converter.cc index 3a938e1..edfa0aa 100644
--- a/krita/plugins/formats/exr/exr_converter.cc
+++ b/krita/plugins/formats/exr/exr_converter.cc
@@ -603,14 +603,19 @@ KisImageBuilder_Result exrConverter::decode(const KUrl& uri)
         dbgFile << "Channel name = " << i.name() << " type = " << channel.type;
 
         QString qname = i.name();
-        QStringList topLevelChannelNames = QStringList() << "A" << "R" << "G" << \
"B"; +        QStringList topLevelChannelNames = QStringList() << "A" << "R" << "G" \
<< "B"  << ".A" << ".R" << ".G" << ".B"  << "A." << "R." << "G." << "B.";;  if \
(topLevelChannelNames.contains(qname)) {  topLevelRGBFound = true;
             dbgFile << "Found top-level channel" << qname;
             info.channelMap[qname] = qname;
             info.updateImageType(imfTypeToKisType(channel.type));
         }
-        else if (qname.startsWith('.') || !qname.contains('.')) {
+        // Channel names that don't contain a "." or that contain a
+        // "." only at the beginning or at the end are not considered
+        // to be part of any layer.
+        else if (!qname.contains('.')
+                 || !qname.mid(1).contains('.')
+                 || !qname.left(qname.size() - 1).contains('.')) {
             warnFile << "Found a top-level channel that is not part of the rendered \
image" << qname << ". Krita will not load this channel.";  }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic