Counting some categories double.

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

Post Reply
Ronn1234
Posts: 2
Joined: Mon Jun 26, 2017 5:30 pm

Counting some categories double.

Post by Ronn1234 »

Hello all,

I am a new user of XnView. I am using this program on my MacBook Air.

I had already made so much categories on my windows and I have copied all of them to mij MacBook air. Some of the categories are counting double at this moment:

I have 8 photo's with the tag 'Tiger', but in the categorie-filter it shows me: 'Tiger (16)'. But there are only 8 pictures with tis tag in the map. What am I doing wrong. (I did change the map name, but didn't copy anything..)

Hope you can help me!

Greets,
Ronald
User avatar
xnview
Author of XnView
Posts: 43442
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Counting some categories double.

Post by xnview »

and when you click on the category, do you see your image two times?
Pierre.
stavro
Posts: 4
Joined: Tue Jan 16, 2018 11:22 am

Re: Counting some categories double.

Post by stavro »

i have the same problem on ubuntu.
before i had the problem with duplicate images in the category.
i had in the db duplicate paths in the folders table (absolut and relativ).
same as mentioned here viewtopic.php?f=82&t=36570&p=146359&hil ... te#p146359
i removed the duplicates from imagesinfo, images and folders table.
so i have no duplicates anymore, except the count on the categories is still wrong.
can you give me an hind how you query and maybe store those counts? didn't find anything in the db.

thanx in advance, stavro
User avatar
michel038
XnThusiast
Posts: 1285
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Counting some categories double.

Post by michel038 »

I already encountered this problem. The two first options in "settings, metadata" were enabled, when foders were read in browser (or when I used "add folders" function of catalog)

Now , I alaways choose the first OR the second option (both : never) and I never get this bug anymore.
stavro
Posts: 4
Joined: Tue Jan 16, 2018 11:22 am

Re: Counting some categories double.

Post by stavro »

how did you solve the wrong count? deleting category?
User avatar
michel038
XnThusiast
Posts: 1285
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Counting some categories double.

Post by michel038 »

Be sure that all catergories are written as IPTC keywords (or xmp subject, or hierarchical xmp) metadata in image files.
It's a good idea also to copy xnview.db in another place for backup.
You can also use "File's categories", export (small arrow in categories panel) to generate a xml file.
( This xml file will contain links between categories and files; almost the whole database can be rebuilt with later import if necessary).


I deleted xnview.db , and , In tools, settings, catalog , deleted all entries in the panel.
Then I rebuilt database with "add folders" for all my folders (several minutes to read metadata in all photos)
So, I got a very clean database.
User avatar
xnview
Author of XnView
Posts: 43442
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Counting some categories double.

Post by xnview »

could you send me the db files?
Pierre.
stavro
Posts: 4
Joined: Tue Jan 16, 2018 11:22 am

Re: Counting some categories double.

Post by stavro »

hi michel038, thanx for the answer. rebuilding the catalog is the last thing i want to do, because i have really complex folder structur on the harddisc where all my photos are stored. i would have do "optimize" this as well in the future but hoped not do be forced to do this now.

hi pierre, before i sent you the files (the are large) can you give me a hint how the calculation of the counts (figure in brackets beside cat list)
is done. as i wrote i had the "duplicate paths" problem. since sql is one of my daily business it was not hard for me to "deduplicate" the db.
i have now no longer duplicates in the following tables: folders, images, imagesinfo. the pictures as physical file exist as well just once and if i click on one category from the list, the pictures now are not shown twice anymore, just count is incorrect. eg 14 when there are just 7 pictures with that cat.
if i remove those 7 from that cat, the count shows still 7 (should be 0 now) but no pictures are shown (of course). i also checkt the xml form the file cat export. it contains no duplicates as well. so where is this count coming from? (sql query? cached some where ?) i cant find anything related (foreign key images -> cats) to that count in the db.

thanx in advanced, stavro
User avatar
xnview
Author of XnView
Posts: 43442
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Counting some categories double.

Post by xnview »

stavro wrote: i have now no longer duplicates in the following tables: folders, images, imagesinfo. the pictures as physical file exist as well just once and if i click on one category from the list, the pictures now are not shown twice anymore, just count is incorrect. eg 14 when there are just 7 pictures with that cat.
you should have duplicate in Tags table too
Pierre.
stavro
Posts: 4
Joined: Tue Jan 16, 2018 11:22 am

Re: Counting some categories double.

Post by stavro »

thanx a lot.
there have been still duplicates in the table tagstree where i can now see the relations between images and tags (categories).
i misunderstood this table at the first short look. thought its the relation between the tags.

sorry to bother you with this and thanx again, stavro.
Post Reply