It is always hard to describe such a feature concisely and completely within the given space.
I guess I will have to try and play with it and see how things react
Categories panel/tree data not updating at startup
Moderators: helmut, XnTriq, xnview
Re: Categories panel/tree data not updating at startup
As part of trying to understand the way categories are handled, I have saved the contents of my 'Categories' tree and then cleared out all data.
In "Settings -> Browser -> Metadata -> IPTC" checking/unchecking "Keywords -> Import XMP Subject or IPTC keyword to Catalog's Categories'"seems to make no difference to whether the Keywords from the file are (imported and then) shown in the Categories tree, nor in Category Sets -> Assigned, even though the data seems to have been read from the file as evident from the 'Info' pane at the lower left.
Creating a bare tree with nothing but a root for the tree did not change the result. Nothing was imported/shown when changing images.
If this results depends on the fact that the data in both the image itself and the database itself was unchanged, how can I remove unwanted data from either or both the image or the database?
In "Settings -> Browser -> Metadata -> IPTC" checking/unchecking "Keywords -> Import XMP Subject or IPTC keyword to Catalog's Categories'"seems to make no difference to whether the Keywords from the file are (imported and then) shown in the Categories tree, nor in Category Sets -> Assigned, even though the data seems to have been read from the file as evident from the 'Info' pane at the lower left.
Creating a bare tree with nothing but a root for the tree did not change the result. Nothing was imported/shown when changing images.
If this results depends on the fact that the data in both the image itself and the database itself was unchanged, how can I remove unwanted data from either or both the image or the database?
Re: Categories panel/tree data not updating at startup
It's a bit difficult for me to read / write english.
So i'll give some guidelines with short sentences
Settings are located in Tools, Settings, (Browser) Metadata
I don't talk about "edit iptc or xmp" windows,..
Categories is a tool to enter keywords in photos, and handle a database (catalog). Categories filter is a searching and filtering tool
I suggest to use iptc + xmp embedded keywords for JPG's , or xmp sidecar for other raw files.
Writing keywords and update catalog:
- Enable "export category ...to keywords" option.
- Select photos, give them a category, and unselect photos : keywords are written into photos, and catalog is updated.
Read existing keywords and update catalog :
- Enable "Import ... keywords to catalog" option
- Select photos containing keywords and click "View, Update catalog from files" : Catalog will be updated
-There are other ways to update catalog :
-- "sometimes" , catalog is updated only if folder is displayed ... sometimes, selecting photos will improve database update
-- Else, go to settings, catalog, click "Add Folder" button and select a folder : keywords will be read in whole folder and subfolders.
- Catalog is in Xnview.db file. If you move, or rename this file, the catalog will be deleted. You can renew it by reading (add folder) the whole root folder of your photos, after the catalog has been deleted.
- I suggest to always have catalog and keywords synchronized.
- Rename categories won't change keywords automatically; instead, create a new category, set it on photos, and unmark previous category.
- All changes in categories panel will take effect only if corresponding photos are selected before, and un-selected after.
It would be useful if someone could write this kind of answer in a good english, and add it to the wiki
So i'll give some guidelines with short sentences
Settings are located in Tools, Settings, (Browser) Metadata
I don't talk about "edit iptc or xmp" windows,..
Categories is a tool to enter keywords in photos, and handle a database (catalog). Categories filter is a searching and filtering tool
I suggest to use iptc + xmp embedded keywords for JPG's , or xmp sidecar for other raw files.
Writing keywords and update catalog:
- Enable "export category ...to keywords" option.
- Select photos, give them a category, and unselect photos : keywords are written into photos, and catalog is updated.
Read existing keywords and update catalog :
- Enable "Import ... keywords to catalog" option
- Select photos containing keywords and click "View, Update catalog from files" : Catalog will be updated
-There are other ways to update catalog :
-- "sometimes" , catalog is updated only if folder is displayed ... sometimes, selecting photos will improve database update
-- Else, go to settings, catalog, click "Add Folder" button and select a folder : keywords will be read in whole folder and subfolders.
- Catalog is in Xnview.db file. If you move, or rename this file, the catalog will be deleted. You can renew it by reading (add folder) the whole root folder of your photos, after the catalog has been deleted.
- I suggest to always have catalog and keywords synchronized.
- Rename categories won't change keywords automatically; instead, create a new category, set it on photos, and unmark previous category.
- All changes in categories panel will take effect only if corresponding photos are selected before, and un-selected after.
It would be useful if someone could write this kind of answer in a good english, and add it to the wiki

Last edited by michel038 on Sat Jan 30, 2021 10:53 pm, edited 2 times in total.
Catalogage avec XnviewMP :
https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Categories panel/tree data not updating at startup
Thank you very much, Michel038, for sticking with me on this.
If I understood the process better, I would not mind to have a go at writing up your comments as an answer for the Wiki, though, I have never even tried to write for it.
For my own use, I have already started to compose a number of topics regarding my use of XnviewMP (XVP) in my own local DB and will definitely expand on your answer for this collection.
But first: when I look for a Wiki relating to XVP, I see a number of answers, but can't be too sure which is _the_ XVP Wiki.
The idea of having to go to the Setting in order to select 'Import' of categories bothers/confuses me a bit.
The same goes for writing the data. When I update categories, I would expect that my choice in settings would be acted upon and the data written, unfortunately, that makes it very easy to propagate mistakes
See below.
When I opened XVP and selected an image, XVP did not import the categories. Only when I selected View-> Update Catalog from Files did XVP display the category data, but it did not check the parent boxes (even though the corresponding option is checked in Settings). At that time it also displayed the 'Assigned' category leaves, but not the parents
This implies that the reading of the category data happens as far as the display in the Info pane is concerned, because all of the expected data appears there, but this data is not displayed in the Categories panel - contrary to what the 'Settings' 'Import ...' implies (to me).
Perhaps there ought to be a way to display the categories as they exist in the DB - in fact, that is what I would expect to see by default in the Categories pane. If data from corresponding fields in the image are read and these conflict with the categories already present tree in the DB, there I would expect to see a dialog pop up showing the discrepancy/ies. This would make it possible/easier to correct misspelled/misplaced categories.
If I understood the process better, I would not mind to have a go at writing up your comments as an answer for the Wiki, though, I have never even tried to write for it.
For my own use, I have already started to compose a number of topics regarding my use of XnviewMP (XVP) in my own local DB and will definitely expand on your answer for this collection.
But first: when I look for a Wiki relating to XVP, I see a number of answers, but can't be too sure which is _the_ XVP Wiki.
The idea of having to go to the Setting in order to select 'Import' of categories bothers/confuses me a bit.
The same goes for writing the data. When I update categories, I would expect that my choice in settings would be acted upon and the data written, unfortunately, that makes it very easy to propagate mistakes

When I opened XVP and selected an image, XVP did not import the categories. Only when I selected View-> Update Catalog from Files did XVP display the category data, but it did not check the parent boxes (even though the corresponding option is checked in Settings). At that time it also displayed the 'Assigned' category leaves, but not the parents
This implies that the reading of the category data happens as far as the display in the Info pane is concerned, because all of the expected data appears there, but this data is not displayed in the Categories panel - contrary to what the 'Settings' 'Import ...' implies (to me).
Perhaps there ought to be a way to display the categories as they exist in the DB - in fact, that is what I would expect to see by default in the Categories pane. If data from corresponding fields in the image are read and these conflict with the categories already present tree in the DB, there I would expect to see a dialog pop up showing the discrepancy/ies. This would make it possible/easier to correct misspelled/misplaced categories.
Which is the best way to keep 'catalog' (==? DB ) synchronized?michel038 wrote: Sat Jan 30, 2021 6:03 pm - Catalog is in Xnview.db file. If you move, or rename this file, the catalog will be deleted. You can renew it by reading (add folder) the whole root folder of your photos.
- I suggest to always have catalog and keywords synchronized.
- Rename categories won't change keywords automatically; instead, create a new category, set it on photos, and unmark previous category.
- All changes in categories panel will take effect only if corresponding photos are selected before, and un-selected after.
Re: Categories panel/tree data not updating at startup
XnviewMp can import hierarchical keywords into hierarchized categories. (xmp:hierarchicalkeywords and maybe some others)but it did not check the parent boxes (even though the corresponding option is checked in Settings).
But ordinary iptc keywords are not hierarchized (nor xmp-dc:subject) so xnviewmp can't build a hierarchy.
I think IPTC keywords can also be hierarchized (settings, metadata : read hierarchical keywords and writehierarchical keywords) but i think this metod is unofficial .
The option for parent keywords takes effect only just as soon as the category box is ticked
The info pane shows metadata embedded in photos, not at all the DB content...This implies that the reading of the category data happens as far as the display in the Info pane is concerned, because all of the expected data appears there, but this data is not displayed in the Categories panel - contrary to what the 'Settings' 'Import ...' implies (to me).
If your photos were tagged with keywords with another software, the "import" settings stays checked, and you'll have to use one of the methods I described to make Xnviewmp read metadata and update its database.
Once the database is updated, see "Categories filter" pane to read the count of photos having each category. It's the only way to see the DB content ...
(or opening xnview.db with a DB browser, or using "file's categories, export..." )
Do not move, rename, tag your photos out of XnViewmp (or import again if changes were done, and a "relocate" feature exists also)Which is the best way to keep 'catalog' (==? DB ) synchronized?
Do not use categories nor keywords in "edit iptc" or "edit xmp" windows ( unless you learnt what are these functions doing)
When you modify a category, all photos having this category must be selected, then unmark / mark the category to make xnviewmp update keywords.
Never forget that keywords are written in photos only when you release selection
maybe other precautions I can't think of now ...

edit :
"Export" option and one of iptc or xmp (Settings, Metadata) must stay checked ...
Last edited by michel038 on Tue Feb 02, 2021 2:32 pm, edited 2 times in total.
Catalogage avec XnviewMP :
https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Categories panel/tree data not updating at startup
That will take a fair bit of thinking to wrap my mind around all of those fine points - not at all self-evident to me.
Thank you very much for your explanations & help on this topic
Thank you very much for your explanations & help on this topic