Bug 468832 - Editing an existing Keyword Tag strips away all IPTC information from the image file.
Summary: Editing an existing Keyword Tag strips away all IPTC information from the ima...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 8.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-22 19:46 UTC by Galen Adams
Modified: 2023-04-25 17:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.1.0
Sentry Crash Report:


Attachments
attachment-79485-0.html (1.63 KB, text/html)
2023-04-22 19:54 UTC, Galen Adams
Details
2023-04-22_111500_7DMkII_0001_AFTER.jpg (704.99 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
2023-04-22_111500_7DMkII_0001_BEFORE.jpg (723.48 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
2023-04-22_111501_7DMkII_0002_AFTER.jpg (698.67 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
2023-04-22_111501_7DMkII_0002_BEFORE.jpg (718.33 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
2023-04-22_111530_7DMkII_0003_AFTER.jpg (645.36 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
2023-04-22_111530_7DMkII_0003_BEFORE.jpg (661.93 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
AFTER.jpg (640.94 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
GPS_Before.jpg (355.81 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
IPTC_Before.jpg (481.82 KB, image/jpeg)
2023-04-23 19:43 UTC, Galen Adams
Details
attachment-211833-0.html (2.04 KB, text/html)
2023-04-23 20:31 UTC, Galen Adams
Details
attachment-212442-0.html (2.72 KB, text/html)
2023-04-23 20:36 UTC, Galen Adams
Details
attachment-435072-0.html (923 bytes, text/html)
2023-04-25 17:04 UTC, Galen Adams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Adams 2023-04-22 19:46:06 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Just noticed this a couple days ago and have had it happen several times since.
If I select all images containing a Keyword Tag and then Right-Click the tag > choose Properties > and edit the name of said tag, all IPTC information in it's entirety is stripped away from the image files = quite frustrating.
This is a new problem that was not present in previous versions.
Comment 1 caulier.gilles 2023-04-22 19:51:02 UTC
Which operating system ?
Which image type ?
Do you use XMP sidecar ?
Do you enable ExifTool to write metadata in image ?
Comment 2 Galen Adams 2023-04-22 19:54:44 UTC
Created attachment 158336 [details]
attachment-79485-0.html

 Which operating system ? 64-bit Windows 7 Pro
Which image type ? jpeg
Do you use XMP sidecar ? NO
Do you enable ExifTool to write metadata in image ? YES

I just noticed it is also stripping away all GPS information

On Sat, Apr 22, 2023 at 2:51 PM <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=468832
>
> caulier.gilles@gmail.com changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |caulier.gilles@gmail.com
>           Component|Tags-Keywords               |Metadata-Iptc
>
> --- Comment #1 from caulier.gilles@gmail.com ---
> Which operating system ?
> Which image type ?
> Do you use XMP sidecar ?
> Do you enable ExifTool to write metadata in image ?
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Maik Qualmann 2023-04-23 05:02:43 UTC
I can't reproduce the issue, the metadata is updated correctly in the image and any IPTC or GPS metadata is preserved.
Please provide a sample image that can be used to reproduce the problem.

Maik
Comment 4 Maik Qualmann 2023-04-23 05:03:36 UTC
Please also create a DebugView log.

Maik
Comment 5 Galen Adams 2023-04-23 19:43:48 UTC
Created attachment 158363 [details]
2023-04-22_111500_7DMkII_0001_AFTER.jpg

There are three BEFORE that should still have all data intact and three
AFTER that got all IPTC and GPS stripped when editing a KeyWord Tag.
Previous versions of digiKam never did this.

I am using version digiKam-8.0.0-20230330T081758-Win64-debug

I will attempt to get a debug log if I can figure out how.

Thanks.



[image: 2023-04-22_111500_7DMkII_0001_BEFORE.jpg]
[image: 2023-04-22_111501_7DMkII_0002_AFTER.jpg]
[image: 2023-04-22_111501_7DMkII_0002_BEFORE.jpg]
[image: 2023-04-22_111530_7DMkII_0003_AFTER.jpg]
[image: 2023-04-22_111530_7DMkII_0003_BEFORE.jpg]
[image: AFTER.jpg]
[image: GPS_Before.jpg]
[image: IPTC_Before.jpg]
[image: 2023-04-22_111500_7DMkII_0001_AFTER.jpg]

On Sun, Apr 23, 2023 at 12:03 AM Maik Qualmann <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=468832
>
> --- Comment #4 from Maik Qualmann <metzpinguin@gmail.com> ---
> Please also create a DebugView log.
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 6 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158364 [details]
2023-04-22_111500_7DMkII_0001_BEFORE.jpg
Comment 7 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158365 [details]
2023-04-22_111501_7DMkII_0002_AFTER.jpg
Comment 8 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158366 [details]
2023-04-22_111501_7DMkII_0002_BEFORE.jpg
Comment 9 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158367 [details]
2023-04-22_111530_7DMkII_0003_AFTER.jpg
Comment 10 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158368 [details]
2023-04-22_111530_7DMkII_0003_BEFORE.jpg
Comment 11 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158369 [details]
AFTER.jpg
Comment 12 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158370 [details]
GPS_Before.jpg
Comment 13 Galen Adams 2023-04-23 19:43:49 UTC
Created attachment 158371 [details]
IPTC_Before.jpg
Comment 14 Maik Qualmann 2023-04-23 20:08:53 UTC
Galen, you're completely confusing something. Please check it out again. Your IPTC and GPS before images have no metadata whatsoever.
Your other before images have different metadata errors where Exiv2 fails, invalid date format, unexpected GPS info pointer etc. In such a case we read the metadata with ExifTool.
All your before pics are more or less broken, your after pics even have IPTC tags.

Check if ExifTool works for you (ExifTool tab in sidebar shows metadata.

With these sample images, digiKam-8.0.0 repaired your images rather than destroying them.

Maik
Comment 15 Maik Qualmann 2023-04-23 20:18:38 UTC
As an example, if you have set GPS data at some older point and not written to the images and now delete tags that also only exist in the database and have activated the option to reread metadata on file change, your GPS information will disappear from the database.

You should first write the metadata from the database to the images if writing metadata is activated in the settings.
For older bugs where metadata wasn't written to images, we can't fix them today.

Maik
Comment 16 Galen Adams 2023-04-23 20:31:17 UTC
Created attachment 158373 [details]
attachment-211833-0.html

If that be the case, why then can I view all the data in the BEFOREs and
not see any IPTC or GPS data at all in the AFTERs; the GPS "Globe"
indicator in digiKam even disappears from the AFTERs.
The GPS is completely stripped from Windows "Properties" in the AFTERs and
disappears in FastStone; it is all there in the BEFOREs.

If digiKam "repaired" the images, why then is that repair not evident in
any other program ?

I am thoroughly confused and at a loss as I am not doing anything different
than I have been doing for ages and never had this before.




On Sun, Apr 23, 2023 at 3:08 PM Maik Qualmann <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=468832
>
> --- Comment #14 from Maik Qualmann <metzpinguin@gmail.com> ---
> Galen, you're completely confusing something. Please check it out again.
> Your
> IPTC and GPS before images have no metadata whatsoever.
> Your other before images have different metadata errors where Exiv2 fails,
> invalid date format, unexpected GPS info pointer etc. In such a case we
> read
> the metadata with ExifTool.
> All your before pics are more or less broken, your after pics even have
> IPTC
> tags.
>
> Check if ExifTool works for you (ExifTool tab in sidebar shows metadata.
>
> With these sample images, digiKam-8.0.0 repaired your images rather than
> destroying them.
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 17 Galen Adams 2023-04-23 20:36:11 UTC
Created attachment 158374 [details]
attachment-212442-0.html

Sorry, I was sending the previous when another message came in.

The GPS is written into the files by the camera.

All other data is written into the files; not just floating around in some
database.

It is all there until I happen to decide to edit a KeyWord Tag and then it
disappears.

On Sun, Apr 23, 2023 at 3:30 PM Galen Adams <gadams3rd@gmail.com> wrote:

> If that be the case, why then can I view all the data in the BEFOREs and
> not see any IPTC or GPS data at all in the AFTERs; the GPS "Globe"
> indicator in digiKam even disappears from the AFTERs.
> The GPS is completely stripped from Windows "Properties" in the AFTERs and
> disappears in FastStone; it is all there in the BEFOREs.
>
> If digiKam "repaired" the images, why then is that repair not evident in
> any other program ?
>
> I am thoroughly confused and at a loss as I am not doing anything
> different than I have been doing for ages and never had this before.
>
>
>
>
> On Sun, Apr 23, 2023 at 3:08 PM Maik Qualmann <bugzilla_noreply@kde.org>
> wrote:
>
>> https://bugs.kde.org/show_bug.cgi?id=468832
>>
>> --- Comment #14 from Maik Qualmann <metzpinguin@gmail.com> ---
>> Galen, you're completely confusing something. Please check it out again.
>> Your
>> IPTC and GPS before images have no metadata whatsoever.
>> Your other before images have different metadata errors where Exiv2 fails,
>> invalid date format, unexpected GPS info pointer etc. In such a case we
>> read
>> the metadata with ExifTool.
>> All your before pics are more or less broken, your after pics even have
>> IPTC
>> tags.
>>
>> Check if ExifTool works for you (ExifTool tab in sidebar shows metadata.
>>
>> With these sample images, digiKam-8.0.0 repaired your images rather than
>> destroying them.
>>
>> Maik
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>
>
Comment 18 Maik Qualmann 2023-04-23 20:40:34 UTC
I see one thing about the GPS information, it exists in EXifTool but doesn't seem to be carried over. I'll look at that tomorrow.
But keep in mind that your image metadata is not valid beforehand.

exiftool -validate -warning -error -a 2023-04-22_111500_7DMkII_0001_BEFORE.jpg

Validate                        : 4 Warnings (3 minor)
Warning                         : [minor] Invalid date/time format for XMP:DateCreated
Warning                         : [minor] IPTC ApplicationRecordVersion too short (0 bytes; should be 2)
Warning                         : [minor] IPTC DateCreated too long (20 bytes; should be 8)
Warning                         : Missing required JPEG IFD0 tag 0x0213 YCbCrPositioning

Maik
Comment 19 Maik Qualmann 2023-04-23 21:27:32 UTC
Git commit e5d2453880118dfb37e8e3e06577306e4a96b6bb by Maik Qualmann.
Committed on 23/04/2023 at 21:26.
Pushed by mqualmann into branch 'master'.

Workaround when reading the EXV container with ExifTool
ExifTool seems to have some strange behavior here,
it needs further investigation.

M  +3    -0    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/commit/e5d2453880118dfb37e8e3e06577306e4a96b6bb
Comment 20 Maik Qualmann 2023-04-24 06:40:34 UTC
Git commit 6122c5fa1e65ff0e57425feda82dd69c21ed97bf by Maik Qualmann.
Committed on 24/04/2023 at 06:39.
Pushed by mqualmann into branch 'master'.

until a solution, disable reading with ExifTool in case of error

M  +1    -1    core/libs/metadataengine/engine/metaengine_fileio.cpp
M  +0    -3    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/commit/6122c5fa1e65ff0e57425feda82dd69c21ed97bf
Comment 21 Maik Qualmann 2023-04-24 19:16:42 UTC
Git commit 5dd43f410069b860ae39742bc89a3af1da9feabf by Maik Qualmann.
Committed on 24/04/2023 at 19:15.
Pushed by mqualmann into branch 'master'.

fix read binary output from the ExifTool process
FIXED-IN: 8.1.0

M  +1    -1    NEWS
M  +11   -1    core/libs/metadataengine/engine/metaengine_fileio.cpp
M  +17   -8    core/libs/metadataengine/exiftool/exiftoolprocess_p.cpp

https://invent.kde.org/graphics/digikam/commit/5dd43f410069b860ae39742bc89a3af1da9feabf
Comment 22 Maik Qualmann 2023-04-24 19:19:06 UTC
Thanks for reporting this important bug and for creating the sample images.

Maik
Comment 23 Galen Adams 2023-04-25 17:04:58 UTC
Created attachment 158421 [details]
attachment-435072-0.html

You're welcome!
and Thank You guys for being patient with me and my problems.

On Mon, Apr 24, 2023 at 2:19 PM Maik Qualmann <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=468832
>
> --- Comment #22 from Maik Qualmann <metzpinguin@gmail.com> ---
> Thanks for reporting this important bug and for creating the sample images.
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.