orbspider wrote:Pierre,
I was messing about and clicked on "Clear all" in the categories options (I should have realised that's not for clearing categories from files, but from the whole list)
Yes, sure. Nevermind now. That's why there is that Wiki page to explain. Also, you could figure it by yourself, since there are the tools for the Categories and not for the Selected files (like eg. right-click menu in the Thumbs pane)
so in effect I lost them, but I had saved my list, and so I inported the list. But then, in the categories Filter pane, all the categories were empty (no files found).
This needs explanation.
Let's say that we have the following category list:
Cat1, Cat2, ..., Cat10
Cat1,.., Cat7 are assigned to files IMG_001, ..., IMG_007
Cat8 is assigned to files IMG_001 (again) and IMG_002 (again)
Cat9 and Cat10 are unassigned.
1. When you exported the categories, all 10 categories were saved.
2. When you deleted the categories,
all 10 categories were deleted together with the links Cat1-IMG_001, Cat2-IMG_002,..., Cat7-IMG_007, Cat8-IMG_001, Cat8-IMG_002
3. When you imported back the categories, all 10 categories were imported. (you can check this in the Categories pane)
However, the Filter pane has 0 files for each category because the Filter pane counts the links which were deleted previously (see paragraph 3 above). By importing the categories the program cannot magically 'restore' the previous links ('references' in DB language) - nor it is safe for it to do because there are too many moving parts involved (categories, files & folders can be moved/deleted/renamed etc.) - this is the job of the backup not of the Category import.
so I rebuilt thumbnails. still empty. then I optimized the db, using clean files + thumbs, then rebuilt thumbnails again, finally categories showed files (in Filter pane).
Too many steps as you know. In fact, the program reread the categories from the (embedded) metadata from JPG photos which you have.
but not all of them which is strange - files got keywords but XnView doesn't see them?
Not that XnView doesn't 'see' them; it is rather the fact that in your category tree there were unassigned categories (Cat9 and Cat10 from my example above).
You can now import the category list which you previously saved to see all the categories showing up in the Category pane. For the Filter pane perhaps the program needs a restart.
It would be nice if we imported a category list and the imported categories could instantly filter files in the db. but that didn't work.
As I explained above this is not feasible. If you want a more detailed explanation, say it, and I try to help you. In a nutshell: importing categories does not 'magically' rebuild the references to photos.
So... I can't have only half or 80% of files getting filtered, I think I'll need to build the db from scratch again.
No, I don't think so. What it is missing I think that is to import the Categories File again.
If you're SURE that some info got lost through your error, then I should ask a question:: Did you made a backup of xnview.db before pressing the 'Clear All' ?
If yes, we can do something to bring back that info, assuming that you really want to do it.