Bug 338532

Summary: Sidecar files are neither created nor updated under Windows
Product: [Applications] digikam Reporter: Piter Dias <piter.dias>
Component: Metadata-SidecarAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahuggel, anantapalani, caulier.gilles
Priority: NOR    
Version: 4.2.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 4.6.0
Sentry Crash Report:
Attachments: Windows (left) and Linux (right) settings
DebugView log

Description Piter Dias 2014-08-24 19:43:06 UTC
Created attachment 88408 [details]
Windows (left) and Linux (right) settings

Sidecar files are neither created nor updated under Windows x64 8.0. I included some tags to my photos without any sidecar file to be created, although the tags are available (saved in the database, perhaps?). The current sidecar files are not touched either when tags are changed.

Under Ubuntu server x64 13.10 everything is good, sidecars are either updated or created, depending on they already exist or not.

Both Windows and Linux have the same settings for metadata.
Comment 1 caulier.gilles 2014-08-24 21:11:20 UTC
Under Windows can you run :

- run kdebugdialog from KDE and turn on debug space of digiKam, especially KEXIV2
- install and run deview.exe to see console output from digiKam
- run digiKam and reproduce the dysfunction
- report here the debugview trace from digiKam.

All is explained here in details : https://www.digikam.org/contrib

Gilles Caulier
Comment 2 Piter Dias 2014-08-25 00:30:18 UTC
Created attachment 88409 [details]
DebugView log

Starting at line 11840, I:
1) Choose L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2
2) Add the tag "Two people"
3) Click "Apply"
5) The sidecar file was not changed
6) Removed the tag "Two people"
7) Click "Apply"
8) The sidecar file was not changed either
Comment 3 caulier.gilles 2014-08-27 17:06:10 UTC
Take a look here if this is not relevant of your problem :

http://dev.exiv2.org/issues/984

Gilles Caulier
Comment 4 caulier.gilles 2014-08-28 20:55:48 UTC
As i can seen in trace :

00011892	1136.48901367	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::MetadataHub::write(class Digikam::DMetadata &,enum Digikam::MetadataHub::WriteMode,const class Digikam::MetadataSettingsContainer &): Write changes++++++++++++++++++++	
00011893	1136.48913574	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::DMetadata::setImageTitles(const class Digikam::CaptionsMap &) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> Title:  QMap()	
00011894	1136.49194336	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::DMetadata::setImageComments(const class Digikam::CaptionsMap &) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> Comment:  QMap()	
00011895	1136.50524902	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::DMetadata::setImagePickLabel(int) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> Pick Label:  0	
00011896	1136.50695801	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::DMetadata::setImageColorLabel(int) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> Color Label:  0	
00011897	1136.50939941	[5296] digikam(5296)/digikam (core) bool __thiscall Digikam::DMetadata::setImageRating(int) const: Rating value to write is out of range!	
00011898	1136.50964355	[5296] digikam(5296)/KEXIV2 class QStringList __thiscall KExiv2Iface::KExiv2::getXmpTagStringSeq(const char *,bool) const: XMP String Seq ( Xmp.digiKam.TagsList ):  ("Places/South America", "Places/South America/Brazil/Sao Paulo", "Places/South America/Brazil/Sao Paulo/Sao Bento Do Sapucai", "Places", "People/Number of people/Two people", "Places/South America/Brazil")	
00011899	1136.51000977	[5296] digikam(5296)/KEXIV2 class QStringList __thiscall KExiv2Iface::KExiv2::getIptcKeywords(void) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> Read Iptc Keywords:  ("Two people")	
00011900	1136.51110840	[5296] digikam(5296)/KEXIV2 bool __thiscall KExiv2Iface::KExiv2::setIptcKeywords(const class QStringList &,const class QStringList &,bool) const: "L:/Photos/2014/08/16/Imersao em Fotografia/_MG_5590.CR2"  ==> New Iptc Keywords:  ("South America", "Sao Paulo", "Sao Bento Do Sapucai", "Brazil", "Places")	
00011901	1136.52380371	[5296] digikam(5296)/KEXIV2 bool __thiscall KExiv2Iface::KExiv2::save(const class QString &) const: KExiv2::metadataWritingMode 1	
00011902	1136.52392578	[5296] digikam(5296)/KEXIV2 bool __thiscall KExiv2Iface::KExiv2::save(const class QString &) const: Will write XMP sidecar for file "_MG_5590.CR2"	
00011903	1136.56262207	[5296] digikam(5296)/KEXIV2 bool __thiscall KExiv2Iface::KExiv2::save(const class QString &) const: Metadata for file ' "_MG_5590.CR2" ' written to XMP sidecar.

All code relevant of XMP sidecar creation/update is called in libkexiv2.

Gilles Caulier
Comment 5 caulier.gilles 2014-08-28 21:02:57 UTC
As i can see :

KExiv2Iface::KExiv2::save(const class QString &) const: Metadata for file ' "_MG_5590.CR2" ' written to XMP sidecar.

This want mean this code is called :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/revisions/master/entry/libkexiv2/kexiv2.cpp#L447

and this call this method :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/revisions/master/entry/libkexiv2/kexiv2_p.cpp#L66

Where only code from Exiv2 shared lib is called and wrapped to C++ exception handler.

So i suspect really an Exiv2 problem here...

Gilles Caulier
Comment 6 caulier.gilles 2014-08-28 21:04:14 UTC
Under Windows, which Exiv2 version you use exactly ?

Look into digiKam Help/Components Info dialog for details.

Gilles Caulier
Comment 7 Piter Dias 2014-08-29 00:22:34 UTC
Windows version is older than Linux one. See below the results from my two environments.

Windows 
digiKam version 4.2.0
CPU cores: 4
Demosaic GPL2 pack support: No
Demosaic GPL3 pack support: No
Exiv2 can write to Jp2: Yes
Exiv2 can write to Jpeg: Yes
Exiv2 can write to Pgf: Yes
Exiv2 can write to Png: Yes
Exiv2 can write to Tiff: Yes
Exiv2 supports XMP metadata: Yes
LibCImg: 130
LibEigen: 3.2.0
LibExiv2: 0.22
LibJPEG: 90
LibJasper: 1.900.1
LibKDE: 4.10.2
LibKExiv2: 2.3.1
LibKGeoMap: 2.0.0
LibKdcraw: 2.4.2
LibLCMS: 2040
LibLensFun: 0.2.6-0
LibPGF: 6.14.12 - internal library
LibPNG: 1.5.14
LibQt: 4.8.4
LibRaw: 0.16.0
LibTIFF: LIBTIFF, Version 3.9.2 Copyright (c) 1988-1996 Sam Leffler Copyright (c) 1991-1996 Silicon Graphics, Inc.
Marble Widget: 0.15.1 (stable version)
Parallelized PGF codec: No
Parallelized demosaicing: Yes
RawSpeed codec support: No
Database backend: QMYSQL
Database internal server: No
Kipi-Plugins: 4.2.0
LibKface: 3.4.0
LibKipi: 2.1.0
LibOpenCV: 2.4.9

Linux
digiKam version 4.2.0
CPU cores: 2
Demosaic GPL2 pack support: Unknown
Demosaic GPL3 pack support: Unknown
Exiv2 can write to Jp2: Yes
Exiv2 can write to Jpeg: Yes
Exiv2 can write to Pgf: Yes
Exiv2 can write to Png: Yes
Exiv2 can write to Tiff: Yes
Exiv2 supports XMP metadata: Yes
LibCImg: 130
LibEigen: 3.2.0
LibExiv2: 0.23
LibJPEG: 80
LibJasper: 1.900.1
LibKDE: 4.11.5
LibKExiv2: 2.3.1
LibKGeoMap: 2.0.0
LibKdcraw: 2.4.2
LibLCMS: 2050
LibLensFun: 0.2.7-0
LibPGF: 6.12.24 - external shared library
LibPNG: 1.2.49
LibQt: 4.8.4
LibRaw: 0.15.3
LibTIFF: LIBTIFF, Version 4.0.2 Copyright (c) 1988-1996 Sam Leffler Copyright (c) 1991-1996 Silicon Graphics, Inc.
Marble Widget: 0.16.5 (stable version)
Parallelized PGF codec: No
Parallelized demosaicing: Unknown
RawSpeed codec support: Unknown
Database backend: QMYSQL
Database internal server: No
Kipi-Plugins: 4.2.0
LibGphoto2: 2.5.2
LibKface: 3.4.0
LibKipi: 2.1.0
LibOpenCV: 2.4.9
Comment 8 caulier.gilles 2014-08-29 06:55:29 UTC
yes, Exiv2 library is an older one, which can be the origin of the problem.

Libkexiv2 interface is the same version, that a good point here.

I CC Exiv2 coordinator to see if he know a Windows bug fixed with version > 0.22

Gilles Caulier
Comment 9 caulier.gilles 2014-08-29 07:01:48 UTC
Ananta,

For next version 4.3.0, it will be nice to use last stable Exiv2 library 0.24 with digiKam to prevent the risk of re-introduce unwanted bugs.

Next digiKAm version 4.3.0 is planed in one week.

I will also add more debug statements in libkexiv2 to see if all stage of metadata saving operations are fine.

Gilles Caulier
Comment 10 caulier.gilles 2014-08-29 07:13:11 UTC
Git commit 3b742540448c602af84fb6b043ec840c2ff1a153 by Gilles Caulier.
Committed on 29/08/2014 at 07:12.
Pushed by cgilles into branch 'master'.

Add more debug statements

M  +12   -3    libkexiv2/kexiv2_p.cpp

http://commits.kde.org/libkexiv2/3b742540448c602af84fb6b043ec840c2ff1a153
Comment 11 Ananta Palani 2014-11-19 11:51:09 UTC
Please test digiKam 4.5.0, this should be fixed now due to major fixes with use of exiv2 on Windows:
    http://download.kde.org/stable/digikam/digiKam-installer-4.5.0-win32.exe.mirrorlist
Comment 12 caulier.gilles 2014-11-19 12:47:37 UTC
Ananta,

Sound like the bug is really fixed. Look this comment :

https://www.digikam.org/node/724#comment-20934

Gilles Caulier