[Digikam-users] Digikam 2.9: Save image comments to file

Peter Albrecht peter at crazymonkeys.de
Fri Oct 12 10:14:23 BST 2012


On 11.10.2012 14:15, Markus Ebert wrote:
> Btw, I am using exiv2 version 0.23-6.1 and libkexiv2 version
> 4.9.2-42.1.

On my system are installed:
  - libkexiv2  4.8.5 (as of KDE version 4.8.5)
  - exiv2  0.21.1


>>> 2012/10/11 Markus Ebert <strohhirn at gmx.de>:
>>>> In the mean time, I figured out that saving comments with
>>>> language "x-default" works, but using "lang=de-DE" does not.

I tried it on my system an saving "de-DE" caption and title
worked. So I would guess, it is not "digikam 2.9.0's fault".

An interesting point:
Setting all kind of caption / title with de-DE / x-default
you find different number of occurences in the file:

 de-caption:       1 (only in XMP data)
 de-title:         1 (only in XMP data
 xdefault-title:   2 (one of them in the XMP data)
 xdefault-caption: 7 (three of them in the XMP data)

By "in the XMP data" I mean: Between "<x:xmpmeta" and
"</x:xmpmeta>" in the jpg-file.


> On 11.10.2012 13:41, Gilles Caulier wrote:
>> =>> Exiv2 supports XMP metadata: Yes
>> 
>> This can be the problem. I remember a bug where this info is show as
>> "Yes", where it's "No" in fact.
>> 
>> Bug is in libkexiv2, already fixed of course.

So if your libkexiv2 or exiv2 has a bug and does not write
XMP data. The x-default caption has good chance to be
written elsewhere in the jpg-file, e.g. in the EXIF data.
(See the numbers above).
This might be, why you find x-default captions in your jpg
and no x-default title or de-DE data.

Solution:
You could try to find newer versions of libkexiv2 (which
might include, to update whole KDE) or exiv2. Or you
downgrade KDE and/or exiv2 to the versions I use, see
version numbers above. These work. ;)
Or you just wait a few weeks, until new versions are
officially released.

Regards,
	Peter
>>
>> Multi-language Caption is managed through Exiv2 library
>> using XMP metadata...
>>
>> Gilles Caulier
>>
>> 2012/10/11 Markus Ebert <strohhirn at gmx.de>:
>>> Hi,
>>>
>>> thanks for your help, I made at least a littele progress.
>>> Firstly,  the output of "Components Information":
>>> --------------------------------
>>>
>>>
>>> digiKam version 2.9.0
>>>
>>> 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
>>>
>>> LibClapack: internal library
>>>
>>> LibExiv2: 0.23
>>>
>>> LibJPEG: 62
>>>
>>> LibJasper: 1.900.1
>>>
>>> LibKDE: 4.9.2 "release 511"
>>>
>>> LibKExiv2: 2.3.0
>>>
>>> LibKGeoMap: 2.0.0
>>>
>>> LibKdcraw: 2.1.0
>>>
>>>
>>> LibLCMS: 119
>>>
>>> LibLensFun: external shared library
>>>
>>> LibLqr: internal library
>>>
>>> LibPGF: 6.12.27 - internal library
>>>
>>> LibPNG: 1.4.11
>>>
>>> LibQt: 4.8.3
>>>
>>> LibRaw: 0.14.6
>>>
>>>
>>> LibTIFF: LIBTIFF, Version 4.0.2 Copyright (c) 1988-1996
>>> Sam Leffler
>>> Copyright (c) 1991-1996 Silicon Graphics, Inc.
>>>
>>> Marble Widget: 0.14.1 (stable release)
>>>
>>>
>>> Parallelized PGF codec: No
>>>
>>> Parallelized demosaicing: Yes
>>>
>>> Database backend: QSQLITE
>>>
>>> LibGphoto2: 2.4.14
>>>
>>> LibKface: 2.0.0
>>>
>>> LibKipi: 1.6.0
>>>
>>> LibOpenCV: 2.4.2
>>>
>>> Libface: 0.2
>>>
>>> --------------------------------
>>>
>>> It seems to contain everything.
>>>
>>>
>>> In the mean time, I figured out that saving comments with
>>> language
>>> "x-default" works, but using "lang=de-DE" does not. When
>>> saving the title,
>>> the language does not matter.
>>> Here's the debugging output for both cases:
>>>
>>> 1) Using "lang=x-default" (working)
>>> --------------
>>>
>>> digikam(3612)/digikam (core)
>>> Digikam::DMetadata::setImageTitles:
>>> "/home/user/bilder/DSC_1229.JPG"  ==> Title:  QMap(("de-DE",
>>> CaptionValues::caption: "mytitle", CaptionValues::author:
>>> "",
>>> CaptionValues::date: QDateTime("")  ) )
>>>
>>> digikam(3612)/digikam (core)
>>> Digikam::DMetadata::setImageComments:
>>> "/home/user/bilder/DSC_1229.JPG"  ==> Comment: 
>>> QMap(("x-default",
>>> CaptionValues::caption: "mycaption",
>>> CaptionValues::author: "",
>>> CaptionValues::date: QDateTime("Thu Oct 11 12:24:26
>>> 2012")  ) )
>>>
>>> --------------
>>>
>>> 2) Using "lang=de-DE" (not working)
>>> --------------
>>>
>>> digikam(3612)/digikam (core)
>>> Digikam::DMetadata::setImageTitles:
>>> "/home/user/bilder/DSC_1229.JPG"  ==> Title:  QMap(("de-DE",
>>> CaptionValues::caption: "mytitle", CaptionValues::author:
>>> "",
>>> CaptionValues::date: QDateTime("")  ) )
>>> digikam(3612)/digikam (core)
>>> Digikam::DMetadata::setImageComments:
>>> "/home/user/bilder/DSC_1229.JPG"  ==> Comment: 
>>> QMap(("de-DE",
>>> CaptionValues::caption: "mycaption",
>>> CaptionValues::author: "",
>>> CaptionValues::date: QDateTime("Thu Oct 11 12:23:48
>>> 2012")  ) )
>>>
>>> -----------------
>>>
>>> At least now I know how to do a workaround by using only
>>> x-default. However
>>> it would be great to get de-DE to work since I don't want
>>> to switch the
>>> language of ~3000 captions by hand.
>>>
>>>
>>> Regards,
>>> Markus
>>>
>>>
>>>
>>> Am 11.10.2012 09:55, schrieb Peter Albrecht:
>>>
>>>> On 10.10.2012 22:05, Markus Ebert wrote:
>>>>> I suspect that something is wrong with a tool digikam
>>>>> relies
>>>>> on (e.g. exiftool did not work out box as it turned out
>>>>> dependencies were wrong),
>>>> In DigiKam, go to "Help" -> "Components Information" and
>>>> post the output on the mailing list.
>>>>
>>>> Mine looks like:
>>>> -------------------------- 8<
>>>> ------------------------------
>>>>> digiKam version 2.9.0
>>>>> 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
>>>>> LibClapack: external shared library
>>>>> LibExiv2: 0.21.1
>>>>> LibJPEG: 80
>>>>> LibJasper: 1.900.1
>>>>> LibKDE: 4.8.5 (4.8.5)
>>>>> LibKExiv2: 2.1.0
>>>>> LibKGeoMap: 2.0.0
>>>>> LibKdcraw: 2.0.1
>>>>> LibLCMS: 119
>>>>> LibLensFun: external shared library
>>>>> LibLqr: internal library
>>>>> LibPGF: 6.12.27 - external shared library
>>>>> LibPNG: 1.5.10
>>>>> LibQt: 4.8.2
>>>>> LibRaw: 0.14.4
>>>>> LibTIFF: LIBTIFF, Version 4.0.2 Copyright (c) 1988-1996
>>>>> Sam Leffler
>>>>> Copyright (c) 1991-1996 Silicon Graphics, Inc.
>>>>> Marble Widget: 0.13.4 (stable release)
>>>>> Parallelized PGF codec: No
>>>>> Parallelized demosaicing: Yes
>>>>> Database backend: QSQLITE
>>>>> LibGphoto2: 2.4.12
>>>>> LibKface: 2.0.0
>>>>> LibKipi: 1.3.0
>>>>> LibOpenCV: 2.3.1
>>>>> Libface: 0.2
>>>> -------------------------- >8
>>>> ------------------------------
>>>>
>>>> Maybe this helps identifying an old library.
>>>>
>>>>
>>>>> ... so is there a possibility to turn
>>>>> on a debug mode such that I can see what happens when
>>>>> digikam tries to write the metadata? Or maybe a logfile?
>>>>> (Starting in console doesn't reveal anything)
>>>> To enable debug output: Start the programm "kdebugdialog",
>>>> search for "digikam" and select all checkboxes. Click "OK"
>>>> and start digikam from your terminal.
>>>>
>>>> Applying title ("mytitle") and caption ("mycaption"), I get
>>>> the following debug output:
>>>> -------------------------- 8<
>>>> ------------------------------
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::DMetadata::setImageTitles:
>>>>> "/home/user/pictures/Pow-img_1418.jpg"  ==> Title: 
>>>>> QMap(("x-default",
>>>>> CaptionValues::caption: "mytitle",
>>>>> CaptionValues::author: "",
>>>>> CaptionValues::date: QDateTime("")  ) )
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::DMetadata::setImageComments:
>>>>> "/home/user/pictures/Pow-img_1418.jpg"  ==> Comment: 
>>>>> QMap(("x-default",
>>>>> CaptionValues::caption: "mycaption",
>>>>> CaptionValues::author: "",
>>>>> CaptionValues::date: QDateTime("Do. Okt 11 09:50:17
>>>>> 2012")  ) )
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::DMetadata::setImageRating: Rating
>>>>> value to write is out of range!
>>>>> digikam(3572)/KEXIV2
>>>>> KExiv2Iface::KExiv2::KExiv2Priv::saveToFile: File
>>>>> Extension:  "jpg"  is supported for writing mode
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::AlbumWatch::rescanDirectory:
>>>>> Detected change, triggering rescan of directory
>>>>> "/home/px79/daten/Bilder
>>>>> (private)/Fotos unsortiert/Incoming"
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::AlbumWatch::rescanDirectory:
>>>>> Detected change, triggering rescan of directory
>>>>> "/home/px79/daten/Bilder
>>>>> (private)/Fotos unsortiert/Incoming"
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::AlbumWatch::rescanDirectory:
>>>>> Detected change, triggering rescan of directory
>>>>> "/home/px79/daten/Bilder
>>>>> (private)/Fotos unsortiert/Incoming"
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::AlbumWatch::rescanDirectory:
>>>>> Detected change, triggering rescan of directory
>>>>> "/home/px79/daten/Bilder
>>>>> (private)/Fotos unsortiert/Incoming"
>>>>> digikam(3572)/digikam (core)
>>>>> Digikam::AlbumWatch::rescanDirectory:
>>>>> Detected change, triggering rescan of directory
>>>>> "/home/px79/daten/Bilder
>>>>> (private)/Fotos unsortiert/Incoming"
>>>>> digikam(3572)/KEXIV2 KExiv2Iface::KExiv2::save:
>>>>> Metadata for file '
>>>>> Pow-img_1418.jpg ' written to file.
>>>> -------------------------- >8
>>>> ------------------------------
>>>>
>>>> Regards,
>>>>          Peter
>>>> _______________________________________________
>>>> Digikam-users mailing list
>>>> Digikam-users at kde.org
>>>> https://mail.kde.org/mailman/listinfo/digikam-users
>>>>
>>> _______________________________________________
>>> Digikam-users mailing list
>>> Digikam-users at kde.org
>>> https://mail.kde.org/mailman/listinfo/digikam-users
>> _______________________________________________
>> Digikam-users mailing list
>> Digikam-users at kde.org
>> https://mail.kde.org/mailman/listinfo/digikam-users
>>
> 
> _______________________________________________
> Digikam-users mailing list
> Digikam-users at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-users
> 



More information about the Digikam-users mailing list