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

List:       kde-commits
Subject:    [digikam/development/6.0.0] libs/dmetadata: displatch FFMpeg keywords to Exif and IPTC
From:       Gilles Caulier <null () kde ! org>
Date:       2018-02-28 22:01:40
Message-ID: E1er9nA-0001YX-M1 () code ! kde ! org
[Download RAW message or body]

Git commit 3762b26d76cf2b5a7b23ba7f221886b7df8d69c5 by Gilles Caulier.
Committed on 28/02/2018 at 22:01.
Pushed by cgilles into branch 'development/6.0.0'.

displatch FFMpeg keywords to Exif and IPTC

M  +18   -1    libs/dmetadata/dmetadata_ffmpeg.cpp

https://commits.kde.org/digikam/3762b26d76cf2b5a7b23ba7f221886b7df8d69c5

diff --git a/libs/dmetadata/dmetadata_ffmpeg.cpp b/libs/dmetadata/dmetadata_ffmpeg.cpp
index 5baa995ab3..2cf2508cbe 100644
--- a/libs/dmetadata/dmetadata_ffmpeg.cpp
+++ b/libs/dmetadata/dmetadata_ffmpeg.cpp
@@ -39,6 +39,7 @@
 #include <QDateTime>
 #include <QFileInfo>
 #include <QMimeDatabase>
+#include <QStringList>
 
 // Local incudes
 
@@ -320,7 +321,23 @@ bool DMetadata::loadUsingFFmpeg(const QString& filePath)
 
     if (entry)
     {
-        setXmpTagString("Xmp.video.InfoText", QString::fromUtf8(entry->value));
+        QString data = QString::fromUtf8(entry->value);
+        setXmpTagString("Xmp.video.InfoText", data);
+
+        QStringList keywords = data.split(QLatin1String("/"));
+        
+        if (keywords.isEmpty())
+        {
+            keywords = data.split(QLatin1String(","));
+            
+            if (keywords.isEmpty())
+            {
+                keywords = data.split(QLatin1String(" "));
+            }
+        }
+        
+        if (!keywords.isEmpty())
+            setXmpKeywords(keywords);
     }
 
     // --------------
[prev in list] [next in list] [prev in thread] [next in thread] 

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