Bug 238823 - WISH: Batch RAW Conversion should copy tags / captions / ratings to the converted file
Summary: WISH: Batch RAW Conversion should copy tags / captions / ratings to the conve...
Alias: None
Product: digikam
Classification: Applications
Component: BatchQueueManager-RAWProcessing (show other bugs)
Version: 1.5.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
Depends on:
Reported: 2010-05-25 21:29 UTC by Sander
Modified: 2017-07-01 21:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.5.0


Note You need to log in before you can comment on or make changes to this bug.
Description Sander 2010-05-25 21:29:47 UTC
Version:           1.2.0 (using KDE 4.4.2) 
OS:                Linux

When converting from raw (MRW in my case) using either the Batch Queue Manager or the Batch RAW Converter, the tags, captions or ratings that were given to a RAW file are not transfered over to the converted file (PNG or JPG in my case). When using the build-in Image Editor, this metadata was transferred to the newly saved image.
I have not tested this with other conversions.
Wish: always copy metadata to the converted file.

Reproducible: Always

Steps to Reproduce:
I did the following:
1. Load a number of RAW files (MRW in my case)
2. Add some tags, ratings and captions to a few files.
3. Convert a few of these files by using right mouse click and choosing edit. I guess this is the build in editor for RAW files.
4. Save the files
5. Lo and behold. The metadata is copied over to the newly saved file.

Doing the same, using either the BQM or the Batch RAW converter does not yield the same result. Namely, the metadata is not copied over to the newly saved file.

I noticed that the metadata was not written to the MRW file. That might be the cause for my problems. Please confirm.

I am available to help with this issues. Please let me know whether you think this issue deserves to be solved!
Comment 1 caulier.gilles 2010-10-05 14:27:42 UTC
The problem do not exist with current code from svn.

Converting RAW to PNG/JPG using BQM preserve digiKam metadata.

Gilles Caulier
Comment 2 caulier.gilles 2010-10-05 14:30:15 UTC
BQM after converting ARW file to PNG and JPEG. metadata are there is target files.


Gilles Caulier
Comment 3 caulier.gilles 2010-10-05 14:44:07 UTC

But, i can reproduce the problem with Batch Raw Converter kipi Plugin ! I don't know why, cause all code is there. digiKam DB do not register info from source to target file !

The proof : http://www.flickr.com/photos/digikam/5053660839/

Look code there :


KIPI::ImageInfo::cloneData() from digiKam kipi interface is called. 

This method is implemented here :


and this method get attributes and reassign it by this method :


Gilles Caulier
Comment 4 caulier.gilles 2010-10-05 14:50:18 UTC

In BQM, i use this call :


... which work very well to clone digiKam metadata between items.

I need to call this method into KipiImageInfo::cloneData() as well instead current code ?

Gilles Caulier
Comment 5 caulier.gilles 2010-10-05 15:18:57 UTC

i implemented this :

Index: kipiiface/kipiimageinfo.cpp
--- kipiiface/kipiimageinfo.cpp (revision 1182609)
+++ kipiiface/kipiimageinfo.cpp (working copy)
@@ -26,6 +26,10 @@
 #include "kipiimageinfo.h"
+// Qt includes
+#include <QDir>
 // KDE includes
 #include <kconfig.h>
@@ -43,6 +47,7 @@
 #include "imageattributeswatch.h"
 #include "globals.h"
 #include "tagscache.h"
+#include "scancontroller.h"
 namespace Digikam
@@ -117,9 +122,19 @@
 void KipiImageInfo::cloneData( ImageInfoShared* other )
-    setDescription( other->description() );
-    setTime( other->time(KIPI::FromInfo), KIPI::FromInfo );
-    addAttributes( other->attributes() );
+    kDebug();
+    KUrl srcDirURL(QDir::cleanPath(path().directory()));
+    PAlbum* srcAlbum = AlbumManager::instance()->findPAlbum(srcDirURL);
+    KUrl dstDirURL(QDir::cleanPath(other->path().directory()));
+    PAlbum* dstAlbum = AlbumManager::instance()->findPAlbum(dstDirURL);
+    if (dstAlbum && srcAlbum)
+    {
+        ImageInfo oldInfo(path().toLocalFile());
+        ScanController::instance()->scanFileDirectlyCopyAttributes(other->path().toLocalFile(), oldInfo.id());
+    }
 QMap<QString, QVariant> KipiImageInfo::attributes()

... and it doesn't work. Sound like KipiImageInfo::cloneData() is never called !

Gilles Caulier
Comment 6 caulier.gilles 2010-10-05 15:24:01 UTC
Marcel, to set debug statement, i can said that KipiImageInfo::cloneData() is called, but i suspect and inversion of calling cloneData from Raw converter plugin (between original file and destination file)

Gilles Caulier
Comment 7 caulier.gilles 2010-10-05 15:43:31 UTC
SVN commit 1182729 by cgilles:

Use right order to clone data from one item to another one.
BUGS: 238823
BUGS: 152208
BUGS: 211558
BUGS: 199318

 M  +1 -1      batchprocessimages/batchprocessimagesdialog.cpp  
 M  +1 -1      dngconverter/plugin/batchdialog.cpp  
 M  +1 -1      rawconverter/batchdialog.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1182729