Bug 233612 - The DocumentName tag is not added when importing [patch]
Summary: The DocumentName tag is not added when importing [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-PostProcessing (show other bugs)
Version: 1.2.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-07 15:38 UTC by Jonas Norlander
Modified: 2017-08-17 16:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.0


Attachments
ImportDocumentName.patch (3.48 KB, patch)
2015-07-04 20:53 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Norlander 2010-04-07 15:38:17 UTC
Version:           1.2.0 (using KDE 4.4.2)
OS:                Linux

When importing images the DocumentName tag should be added when the image or the metadata is changed.
With Digikam 1.2.0 the DocumentName tag is only added if the image is rotated during the import, no matter if you change the metadata (adding a template) during the import or not.
I don't know if it is added if the images are converted during import.
Comment 1 Marcel Wiesweg 2011-01-26 12:16:58 UTC
What is the specification of this tag?
Currently, I see that it is set to the original file path when an (edited) image  is saved, or when a JPEG operation like rotation is done.
Comment 3 Marcel Wiesweg 2011-01-26 16:57:31 UTC
From that, I would understand the tag gives the original file name. In which case the use in DImg's updateMetadata is all right, in jpegutils doubtful, if the file is changed in place.

Jonas, as reporter of this bug, what it your usage of this tag?
Comment 4 Jonas Norlander 2011-01-26 18:05:54 UTC
It has been almost a year since I reported this bug and reading my bug report now don't make much sense.

I'm not sure exactly what I was doing when reporting this but if I remember right it was during import and if autorotate was enabled the DocumentName tag was updated/added _only_ when the picture was rotated.
Renaming the files during import could have something with it to do to, as I think the value of the DocumentName tag was updated with the old name of the file before it was renamed during the imported.

Storing the original filename in the tag can be a good thing to do, I think.
Comment 5 Jonas Norlander 2011-02-19 13:56:40 UTC
The bug is still there for me with Digikam 1.8.0. What version of Digikam are you using? I thought I check if this bug is still there when i was importing some photos and it turns out the bug is still there.

When importing (from flash card), if the picture is auto rotated the Exif tags
Exif.Image.ImageWidth, Exif.Image.ImageLength and Exif.Image.DocumentName is added. For those pictures that not are rotated this tags is not added.
I think this tags should always be added when importing not only when the pictures are rotated. At least it should be the same rotated or not.

This is JPEG pictures from an Canon IXUS 100is.
Comment 6 Marcel Wiesweg 2011-02-19 15:09:10 UTC
The question is still what the tag is supposed to mean. The specification does not really help.
Comment 7 caulier.gilles 2011-02-19 15:13:00 UTC
The tag is used to store the information about the origine of the image.

If the file created come from another one, for ex, by a conversion (as TIFF to JPEG), we must copy the original file name with TIFF extension in this tag.

If file is created from a device (a scanner for ex), we copy the scanner information.

I use this way into RAW converter or in image editor.

In camera interface, if file is converted from JPEG to lossless format, tag must be patched.

Gilles Caulier
Comment 8 caulier.gilles 2011-08-09 09:27:18 UTC
Marcel,

Some progress here from you ?

Gilles Caulier
Comment 9 caulier.gilles 2011-12-18 13:56:05 UTC
Jonas,

This file still valid using digiKam 2.4 ?

Gilles Caulier
Comment 10 Marcel Wiesweg 2012-03-12 11:12:39 UTC
DImg::prepareMetadataToSave is settings the DocumentName tag, and is called from ImageEditor, batch tool and fileworker iface. Apparently not from CameraInterface, so probably this one is missing to fix this bug?
Comment 11 alain.quincerot_lnx 2015-04-02 09:12:11 UTC
Purpose : I use this tag for adding comment to images, and then use it in html export.

Presently, I receive images from my relatives with this tag and I import them into my digikam.

the "Dublin Core" Title is not displayed below the thumbnail by digikam, whatever the lang is set (fr-FR or x-default).
however the Metadata tab (in the XMP part) displays the title.
This happens on images whom dc.title has been set with digikam (version 4.8.0) running on Windows 8.1
then transferred to digikam 4.6.0 on openSuse 13.2  using exiv2 0.24 001800 (64 bit build)

Note : I remember I have already seen this problem 2 years ago with older versions.
Comment 12 Maik Qualmann 2015-04-02 20:18:32 UTC
I can not confirm this bug. The "Dublin Core" title is in the DB imported and displayed under the thumbnail, when the title checkbox ist activated.

Maik
Comment 13 caulier.gilles 2015-04-02 20:39:18 UTC
Same for me. This bug is not reproducible here. This probably depend of Exiv2 and libkexiv2 shared libs installed and used by digiKam...

Gilles Caulier
Comment 14 caulier.gilles 2015-04-02 20:41:56 UTC
oups, subject of this entry is not DC tags, by DocumentName tag. This is different.

Else problem from comment #11 is not reproducible here...

Gilles Caulier
Comment 15 caulier.gilles 2015-05-12 13:05:02 UTC
Maik,

Do you  see comment #10 from Marcel ?

Anyway, it can be easy to see if problem is reproducible while download, when not specific operation is done on metadata.

The Exif DocumentName must be set in all cases, as it's ask in original report.

Gilles
Comment 16 Maik Qualmann 2015-07-04 20:53:33 UTC
Created attachment 93478 [details]
ImportDocumentName.patch

This patch set the document name when images are imported. It also resolves that color labels, pick labels and rating are set if no template is applied. We set metadata only for JPEG files when importing, but we could not apply it to other image formats (TIFF, PNG)?

Maik
Comment 17 caulier.gilles 2015-07-04 22:09:46 UTC
Comment on attachment 93478 [details]
ImportDocumentName.patch

There is no limitation about file format to patch, if Exiv2 support it. This is the case for PNG, and TIFF.

But applying over all type of image format require more work especially with read only files as RAW. There is a file about this topic in bugzilla if i remember.

Typically, we must set a metadata cache in import tool including all change to apply to files while importing, download files, scan new items, and patch DB.

Gilles
Comment 18 caulier.gilles 2015-07-04 22:10:24 UTC
Forget to said, that patch sounds fine for me.

Gilles
Comment 19 Maik Qualmann 2015-07-05 06:49:11 UTC
Git commit 52bb19ec9265a7fae58d65de502b8e417c46f0ce by Maik Qualmann.
Committed on 05/07/2015 at 06:37.
Pushed by mqualmann into branch 'master'.

apply patch #93478 to added the DocumentName tag when importing images
FIXED-IN: 4.12.0

M  +2    -2    NEWS
M  +34   -27   utilities/importui/backend/cameracontroller.cpp

http://commits.kde.org/digikam/52bb19ec9265a7fae58d65de502b8e417c46f0ce
Comment 20 caulier.gilles 2015-07-05 08:23:33 UTC
Git commit 2de7ad489b546bff770d7c0b8755eedbaecd93f4 by Gilles Caulier.
Committed on 05/07/2015 at 08:22.
Pushed by cgilles into branch 'frameworks'.

backport commit #52bb19ec9265a7fae58d65de502b8e417c46f0ce from git/master to frameworks branch

M  +34   -28   utilities/importui/backend/cameracontroller.cpp

http://commits.kde.org/digikam/2de7ad489b546bff770d7c0b8755eedbaecd93f4