Page 1 of 1

Re-read categories?

Posted: Wed Aug 16, 2017 9:25 pm
by 3x5
Hi, I made the mistake of moving some photo folders around in my file manager, and not in xnview. Now a lot of my categories don't link to anything.

Is there a way to clear these categories and reload them from the tags in the photos themselves?

Re: Re-read categories?

Posted: Wed Aug 16, 2017 9:35 pm
by 3x5
Nevermind, I just deleted the .db files.

Re: Re-read categories?

Posted: Thu Aug 17, 2017 4:19 pm
by michel038
If someone needs an answer , two solutions

1)
When you use categories, you should sometimes export Files's categories as a xml file.
(select at least 1 picture, then in Categories panel, right-click the small arrow menu, choose "File's categories", Export )
This XML (TEXT) file will contain paths, filenames, linked with categories. It's a backup for the database.

If xnview.db database is deleted or corrupted, then you will be able to import the same file.
If paths have changed, you can edit the xml file, use "search and replace" ... and import.

2)
You want to rebuild the whole database.
Close xnview, rename xnview.db as xnview.old, open xnview,
Go to "Tools, settings, metadata" - check "Import XMP ... to categories" and un-check the second box (Export DB ...) .
Verify other options you need to use.
Go to "Tools, settings,Catalog" , click "Add folder" until all your folders having photos are read ... maybe a long processing time.
Done

Re: Re-read categories?

Posted: Thu Aug 17, 2017 4:24 pm
by rinthe
michel038 wrote: 2)
You want to rebuild the whole database.
Close xnview, rename xnview.db as xnview.old, open xnview,
Go to "Tools, settings, metadata" - check "Import XMP ... to categories" and un-check the second box (Export DB ...) .
Verify other options you need to use.
Go to "Tools, settings,Catalog" , click "Add folder" until all your folders having photos are read ... maybe a long processing time.
Done
I'm curious. What's the point of un-checking the second box (Export DB ...)? All you really need is to check "import XMP" and it will rebuild right?

Re: Re-read categories?

Posted: Thu Aug 17, 2017 9:04 pm
by michel038
sorry for my poor english.
If both
"Import XMP subject or IPTC keywords to DB Categories"
and
"Export DB Category to XMP subject and IPTC keywords "
options
... are checked, categories will (sometimes) contain each picture two times.

So, when building categories database, check the first option only.
When using categories for tagging , check only the second one.

In the next "settings" screen (Tools, settings, Catalog) it's the "add folder" button that builds the database.