Bug 300920 - tags are stored multiple times
Summary: tags are stored multiple times
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Engine (show other bugs)
Version: 2.5.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-31 09:56 UTC by koperwiek
Modified: 2012-06-27 07:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.6.0


Attachments
Schermafdruk van 2012-05-31 22:26:20.png (103.66 KB, image/png)
2012-05-31 20:30 UTC, koperwiek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description koperwiek 2012-05-31 09:56:19 UTC
assign tag A to an image, hit 'apply'
assign tag B to the same image, hit 'apply'
tag A is now 2 times assigned to A (also two times in the database in the ImageTags table).

Reproducible: Always



Expected Results:  
A tag should only be assigned once to an image
Comment 1 caulier.gilles 2012-05-31 10:01:58 UTC
Not reproducible here. Which version of digiKam you use ?

Do you share tags with Nepomuk (look Metadata setup for details) ?

Gilles Caulier
Comment 2 koperwiek 2012-05-31 10:46:22 UTC
Digikam Versie 2.5.0
Gebruikmakend van KDE Development Platform 4.8.2 (4.8.2)

Do not share tags with Nepomuk

Han van Os

Gilles Caulier schreef op do 31-05-2012 om 10:01 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> Gilles Caulier <caulier.gilles@gmail.com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |caulier.gilles@gmail.com
> 
> --- Comment #1 from Gilles Caulier <caulier.gilles@gmail.com> ---
> Not reproducible here. Which version of digiKam you use ?
> 
> Do you share tags with Nepomuk (look Metadata setup for details) ?
> 
> Gilles Caulier
>
Comment 3 caulier.gilles 2012-05-31 10:49:58 UTC
Which Database type do you use ? Mysql or sqlite ?

If you store tags into image metadata (check Metadata setup dialog), look your image metadata to see if dual tags are stored in XMP or IPTC or Exif ?

Gilles Caulier
Comment 4 koperwiek 2012-05-31 11:12:09 UTC
In the metadata they are ok (each tag once).
In the database and below the thumbnail they are  multiple,

Han van Os

Gilles Caulier schreef op do 31-05-2012 om 10:49 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> --- Comment #3 from Gilles Caulier <caulier.gilles@gmail.com> ---
> Which Database type do you use ? Mysql or sqlite ?
> 
> If you store tags into image metadata (check Metadata setup dialog), look your
> image metadata to see if dual tags are stored in XMP or IPTC or Exif ?
> 
> Gilles Caulier
>
Comment 5 caulier.gilles 2012-05-31 11:40:03 UTC
run kdebugdialog and turn on digikam debug space.
run digiKam from a console, assign tags to image and look debug trace on the console. There is any suitable info to hack ?

Gilles Caulier
Comment 6 koperwiek 2012-05-31 11:52:53 UTC
I activated Digikam in kdebugdialog.
Started Digikam from console.
Assigning tags only results messages about image orientation:

digikam(5524)/digikam (core) Digikam::DImg::load:
"/home/han/Afbeeldingen/Afbeeldingenmap/2012/2012-05-12/L1030866.jpg"  :
JPEG file identified
digikam(5524)/digikam (core) Digikam::DImg::load:
"/home/han/Afbeeldingen/Afbeeldingenmap/2012/2012-05-12/L1030866.jpg"  :
JPEG file identified
digikam(5524)/KEXIV2 KExiv2Iface::KExiv2::getImageOrientation:
Orientation => Exif.Image.Orientation =>  1
digikam(5524)/KEXIV2 KExiv2Iface::KExiv2::getImageOrientation:
Orientation => Exif.Image.Orientation =>  1


Han v Os

Gilles Caulier schreef op do 31-05-2012 om 11:40 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> --- Comment #5 from Gilles Caulier <caulier.gilles@gmail.com> ---
> run kdebugdialog and turn on digikam debug space.
> run digiKam from a console, assign tags to image and look debug trace on the
> console. There is any suitable info to hack ?
> 
> Gilles Caulier
>
Comment 7 caulier.gilles 2012-05-31 11:56:48 UTC
There is nothing special to see in the console.

Can you share your DB file for investigations ?

Gilles Caulier
Comment 8 koperwiek 2012-05-31 12:10:34 UTC
You will receive my database via WeTransfer.com within some minutes

Han v Os

Gilles Caulier schreef op do 31-05-2012 om 11:56 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> --- Comment #7 from Gilles Caulier <caulier.gilles@gmail.com> ---
> There is nothing special to see in the console.
> 
> Can you share your DB file for investigations ?
> 
> Gilles Caulier
>
Comment 9 Marcel Wiesweg 2012-05-31 18:04:15 UTC
Created attachment 71483 [details]
Schermafdruk van 2012-05-31 22:26:20.png

CREATE TABLE ImageTags
 (imageid INTEGER NOT NULL,
  tagid INTEGER NOT NULL,
  UNIQUE (imageid, tagid));

Any duplicate entry in the database would be violating the table definition.
How do you check the entries? MySQL or SQLite?
Comment 10 koperwiek 2012-05-31 20:30:30 UTC
sqlite.
check screenprint of database browser attached.

HvO

Marcel Wiesweg schreef op do 31-05-2012 om 18:04 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> --- Comment #9 from Marcel Wiesweg <marcel.wiesweg@gmx.de> ---
> CREATE TABLE ImageTags
>  (imageid INTEGER NOT NULL,
>   tagid INTEGER NOT NULL,
>   UNIQUE (imageid, tagid));
> 
> Any duplicate entry in the database would be violating the table definition.
> How do you check the entries? MySQL or SQLite?
>
Comment 11 koperwiek 2012-05-31 20:43:14 UTC
I checked the database. The Create table statement does not contain the
constraints mentioned below. So the problem is solved, as far as i am
concerned.  I will repair the database.
Thank kindly for your help.

Best regards, Han van Os


Marcel Wiesweg schreef op do 31-05-2012 om 18:04 [+0000]:
> https://bugs.kde.org/show_bug.cgi?id=300920
> 
> --- Comment #9 from Marcel Wiesweg <marcel.wiesweg@gmx.de> ---
> CREATE TABLE ImageTags
>  (imageid INTEGER NOT NULL,
>   tagid INTEGER NOT NULL,
>   UNIQUE (imageid, tagid));
> 
> Any duplicate entry in the database would be violating the table definition.
> How do you check the entries? MySQL or SQLite?
>
Comment 12 Marcel Wiesweg 2012-06-01 20:19:27 UTC
Still weird that the UNIQUE constraint was not in your database's schema. It's definitely in the SQL code that we ship.