Bug 436571 - Tooltips for images don't show tags containing "<" correctly
Summary: Tooltips for images don't show tags containing "<" correctly
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-IconView (show other bugs)
Version: 7.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-04 09:02 UTC by Quincy
Modified: 2021-05-05 06:26 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Quincy 2021-05-04 09:02:28 UTC
SUMMARY
Tooltips for images don't show tags containing "<" correctly. In table view display is correct.

STEPS TO REPRODUCE
1. Create a tag containing "<" e.g. "good (<=5%)"
2. Assign it to an imgae
3. Hover over image in thumbnail view displaying the tooltip with digiKam properties

OBSERVED RESULT
Text is cut off at "<" symbol

EXPECTED RESULT
Text should be completely displayed as also other tags do
Comment 1 caulier.gilles 2021-05-04 09:06:00 UTC
Can you provide an image sample including this kind of tags in metadata to reproduce 

Thanks in advance

Gilles Caulier
Comment 2 Maik Qualmann 2021-05-04 09:38:58 UTC
The tooltip is rendered in HTML. I guess we need to encode the tag text with QString::toHtmlEscaped().

Maik
Comment 3 Quincy 2021-05-04 12:46:18 UTC
@Gilles: It is not metadata saved within the image, but a tag assigned via digiKam (database only).

I think Maik is right, as "Test <bla> Test2" completely removes the part between the angle brackets.
Comment 4 caulier.gilles 2021-05-04 12:53:39 UTC
yes it's tag, but it can be hosted in file metadata for interoperability.

So yes a such image with this king of tag, imported in a local session of digiKam can help to reproduce the problem.

Gilles Caulier
Comment 5 Maik Qualmann 2021-05-04 17:11:01 UTC
Git commit 7a672537ee7671355384bd86ee9b47a5db2ab3eb by Maik Qualmann.
Committed on 04/05/2021 at 17:09.
Pushed by mqualmann into branch 'master'.

use HTML escape for tags in the tooltip
FIXED-IN: 7.3.0

M  +1    -2    NEWS
M  +1    -1    core/app/items/utils/tooltipfiller.cpp

https://invent.kde.org/graphics/digikam/commit/7a672537ee7671355384bd86ee9b47a5db2ab3eb
Comment 6 Quincy 2021-05-05 06:26:46 UTC
Thanks Maik for the quick fix!

@Gilles: I usually do not taint the image files with anything, so I had to find again how to reactivate that behavior temporarily.
BTW on that: The Menu entry to write metadata into files (now) is active but obviously useless if nothing is checked in the settings which metadata should be written to files. If something is checked the use is limited to the case where "lazy synchronization" is activated, too as otherwise this is done on-the-fly anyway.