Bug 152219 - impossible to clear comments in metadata
Summary: impossible to clear comments in metadata
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 0.9.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-12 21:13 UTC by rom1v
Modified: 2017-08-13 15:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rom1v 2007-11-12 21:13:24 UTC
Version:           0.92 (using KDE KDE 3.5.8)
Installed from:    Ubuntu Packages
OS:                Linux

In Configuration > Metadata, I enabled "save image comments in metadata" (the translation may not be exact), to save comments in image metadata.

Before putting a comment on image.jpg, I computed its md5sum (md5sum image.jpg).
If I add a comment, the md5sum changes, so it seems ok. If I change the comment, the md5sum changes again. But if I remove (clear) the comment, the md5sum stay the same (so no modification in the file).

So it is not possible to clear a comment in metadata... (even if the database of digikam seems to remember the clear, the file doesn't)
Comment 1 rom1v 2007-11-12 21:14:29 UTC
And if you "write metadata in digikam database" after a clear, you can see the clear has not been done.
Comment 2 Paweł Marciniak 2007-11-12 21:20:54 UTC
There is a special menu entry for that. Try Image->Metadata->Remove Captions...
Comment 3 rom1v 2007-11-12 21:24:05 UTC
OK this is a way to evade the bug, but the bug is still here (when you "apply" with an empty comment, it seems to work in the gui, because it's correctly written to digikam database, but it doesn't write the metadata).
Comment 4 caulier.gilles 2007-11-12 21:44:48 UTC
Sound like a cache problem from MetadataHub.

Marcel, What do you think about ?

Gilles
Comment 5 Marcel Wiesweg 2007-11-12 22:53:30 UTC
For the old JFIF comment, KExiv2::save(QString):
        if (!d->imageComments.empty())
        {
            image->setComment(d->imageComments);
        }
For the Exif comment, setExifComment():
        if (comment.isEmpty())
            return false;

Perhaps we can use isNull() instead of isEmpty()?
Comment 6 caulier.gilles 2007-11-17 18:55:25 UTC
Yes, Marcel, you have right. An empty string is a valid comment like Romain said...

Arnd, it's a simple patch to do (:=)))

Gilles
Comment 7 Marcel Wiesweg 2007-11-18 15:46:27 UTC
In one of the cases there is std::string, which does not have isNull/isEmpty distinction. Perhaps we use a QByteArray there instead?
Comment 8 rom1v 2007-12-15 12:43:53 UTC
Is it fixed?
Comment 9 x3ri7yz02 2008-05-27 05:32:02 UTC
Testing with current SVN (revisions:  exiv2 1463, graphics 813168, libs 813167) -    able to reproduce this bug.

Tested checking metadata manually (using exiv2 at command line and checking Metadata using Digikam) and via md5sums.

Removing a comment using the Digikam GUI does not remove it from EXIF or IPTC metadata.  (Although it does change image md5sums)
Comment 10 caulier.gilles 2009-06-11 19:31:56 UTC
To all,

This entry still valid with digiKam 0.10.0 and Exiv2 0.18.1 ?

Gilles Caulier
Comment 11 x3ri7yz02 2009-06-12 03:33:49 UTC
Hi Gilles,

Yes - this bug is still present with v0.10.0 (libexiv2 0.18.1).

Testing:
- check md5sum of image (eg e54d48f8c3cd15bb7ae458706c07dbc2)
- add text via "Caption" box on right-hand panel
- confirm md5sum changed (now 46d6ffe11d469423ea35008822279e2b)
- remove text from "Caption" box again.
- md5sum is different to both above  (now b909302feb53bbff783b697303962afa)
- text is not visible in "Caption" box.  But is still stored in image, viewable via "Image->Metadata->Edit Exif (or IPTC,XMP)

Using "Image->Metadata->Remove Captions" seems to remove the stored text. (md5sum now 7a7a3a6e2ec87facd4e9586b8f470f70)
Comment 12 caulier.gilles 2009-06-22 11:50:18 UTC
SVN commit 985160 by cgilles:

polish comments metadata registration. If default comment string isNull (not isEmpty), tags which host only one comments are removed as well.
CCBUGS: 152219



 M  +25 -24    kexiv2exif.cpp  
 M  +14 -11    kexiv2xmp.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=985160
Comment 13 caulier.gilles 2009-06-22 11:51:38 UTC
SVN commit 985161 by cgilles:

fix null comments registration to metadata
BUGS: 152219


 M  +25 -13    dmetadata.cpp  


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