[digikam] [Bug 371578] New: untagged images no longer shown in "no tags" overview when removing existing tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 371578] New: untagged images no longer shown in "no tags" overview when removing existing tag

bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371578

            Bug ID: 371578
           Summary: untagged images no longer shown in "no tags" overview
                    when removing existing tag
           Product: digikam
           Version: 5.1.0
          Platform: Fedora RPMs
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Tags
          Assignee: [hidden email]
          Reporter: [hidden email]

When removing all tags from an image file using the "Captions/Tags" sidebar the
image is not listed in the "No Tags" overview.

Reproducible: Always

Steps to Reproduce:
1. add a fresh image (verify that it shows up in the "No Tags" overview)
2. tag the image (the image file now vanished from the "No Tags" overview)
3. remove the tag _using "Captions/Tags" sidebar

Actual Results:  
image file is not listed in "No Tags"

Expected Results:  
image file should be listed in "No Tags"

When tagging an image, e.g. with "mytag", it seems that also the tags "Color
Label None" and "Pick Label None" are applied to that image. When removing the
"mytag" tag, the other two tags stay in place so the image file still has
"tags", although they're not visible.

Example:
# image 84265 is freshly added
MariaDB [digikam]> select * from ImageTags where imageid = 84265;
Empty set (0.00 sec)

# tag the image with "mytag"
MariaDB [digikam]> select * from Tags where id in (select tagid from ImageTags
where imageid = 84265);
+-----+------+------------------+------+---------+-----+-----+
| id  | pid  | name             | icon | iconkde | lft | rgt |
+-----+------+------------------+------+---------+-----+-----+
|  87 |   11 | mytag            | NULL | NULL    | 775 | 834 |
|  97 |   92 | Color Label None | NULL | NULL    | 698 | 699 |
| 107 |   92 | Pick Label None  | NULL | NULL    | 678 | 679 |
+-----+------+------------------+------+---------+-----+-----+
3 rows in set (0.00 sec)

# remove the tag "mytag"
MariaDB [digikam]> select * from Tags where id in (select tagid from ImageTags
where imageid = 84265);
+-----+------+------------------+------+---------+-----+-----+
| id  | pid  | name             | icon | iconkde | lft | rgt |
+-----+------+------------------+------+---------+-----+-----+
|  97 |   92 | Color Label None | NULL | NULL    | 698 | 699 |
| 107 |   92 | Pick Label None  | NULL | NULL    | 678 | 679 |
+-----+------+------------------+------+---------+-----+-----+
2 rows in set (0.00 sec)

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 371578] untagged images no longer shown in "no tags" overview when removing existing tag

bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371578

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
          Component|Tags                        |Database-Mysql

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 371578] untagged images no longer shown in "no tags" overview when removing existing tag

bugzilla_noreply
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371578

--- Comment #1 from [hidden email] ---
For those who want to "clean up" their database, that's how I did it.
Please be REALLY careful and VERIFY the results BEFORE the delete statement.

CREATE TABLE ImageDeleteMe (imageid INT(11) NOT NULL);

INSERT INTO ImageDeleteMe
    SELECT DISTINCT imageid FROM ImageTags WHERE
        tagid IN (
            SELECT id FROM Tags WHERE pid = (
                SELECT id FROM Tags WHERE name = '_Digikam_Internal_Tags_'
            ) AND name LIKE ('% None')
        ) AND
        imageid NOT IN (
            SELECT imageid FROM ImageTags WHERE tagid NOT IN (
                SELECT id FROM Tags WHERE pid = (
                    SELECT id FROM Tags WHERE name = '_Digikam_Internal_Tags_'
                ) AND name LIKE ('% None')
            )
        );  

DELETE FROM ImageTags WHERE imageid IN (
    SELECT imageid FROM ImageDeleteMe
);

DROP TABLE ImageDeleteMe;

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 371578] untagged images no longer shown in "no tags" overview when removing existing tag

bugzilla_noreply
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371578

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #2 from [hidden email] ---
This issue is reproducible for me. (Using digiKam 5.2.0)

What I did :
1) Create a new album and add a new image. (Shown in "no tags" overview)
2) Assign a new tag (Removed from "no tags" overview)
3) Removed tag using Caption/Tags sidebar.

Observations
1) I think on removing the tags from Caption/Tags sidebar, the tags are just
removed from the picture. "Actually" the tags are still present in the
database. On running :
 SELECT * FROM TAGS; before and after assigning tags, tags remains in the
table.
 But, SELECT * FROM IMAGETAGS; the tag is present before removal in the table.
This implies the "Apply" after unchecking the specific tag works fine.

2) After removal of tag, the image doesn't appear in "No tags" overview. Also,
I note that:
-->Select Tags view from left
-->Click on the tag you assigned from the tags tree.
-->No image is visible for that tag.

Also, image isn't visible if digiKam is restarted at neither of the two places.

--
You are receiving this mail because:
You are the assignee for the bug.