Milking the database for categories
Moderators: helmut, XnTriq, xnview
Milking the database for categories
Is the following scenario viable?
This is written under the assumption that categories are part of the binary BLOB called 'Meta' in XnView.db's Images table. My photos, once in the database, tend to stay as they are as I work on copies.
1. After setting categories for my images, I access the database (with XnViewMP not running of course) via a self-written script that reads and writes all image filenames (or IDs) and the complete 'Meta' blobs to a separate file.
2. Later I have to recreate the database for whatever reason, but we can assume, for the sake of the discussion, that the image files themselves are completely unchanged and that there are no additions or deletions.
3. If then I read the 'Meta' blobs and filenames from my saved file and and write the blobs back into the newly created database, should that process recreate my categories as well?
I know this is probably a highly unsafe procedure and I will (try to) make sure that my database never gets corrupted and that I do have backups... but better safe than sorry.
This is written under the assumption that categories are part of the binary BLOB called 'Meta' in XnView.db's Images table. My photos, once in the database, tend to stay as they are as I work on copies.
1. After setting categories for my images, I access the database (with XnViewMP not running of course) via a self-written script that reads and writes all image filenames (or IDs) and the complete 'Meta' blobs to a separate file.
2. Later I have to recreate the database for whatever reason, but we can assume, for the sake of the discussion, that the image files themselves are completely unchanged and that there are no additions or deletions.
3. If then I read the 'Meta' blobs and filenames from my saved file and and write the blobs back into the newly created database, should that process recreate my categories as well?
I know this is probably a highly unsafe procedure and I will (try to) make sure that my database never gets corrupted and that I do have backups... but better safe than sorry.
Re: Milking the database for categories
no XnViewMP read metadata, and create entries in category table
Pierre.
Re: Milking the database for categories
Sure. But what happens I simply overwrite the Meta blob with the data saved earlier? (Remember that my question implied that the photos and therefore also the metadata are unchanged.)xnview wrote:no XnViewMP read metadata, and create entries in category table
Alternatively, if you either add a method to save and restore the categories part of the metadata or make the synchronisation between database categories and XMP tags more reliable, then I'd not need to jump through any of those hoops.
Re: Milking the database for categories
Well, I am at a complete loss then as how to work reliably with categories. How can I can add complex category information to 25,000+ photos without a sensible restoration strategy? In principle, the XMP export should work but in practice this is, in the current implementation, much too brittle to trust.
A real pity, because in all other respects XnViewMP fits the bill.
A real pity, because in all other respects XnViewMP fits the bill.
Re: Milking the database for categories
you would like to recreate the database with categories?
Pierre.
Re: Milking the database for categories
Basically yes. Most, if not all, metadata in the database can be re-created if the database has to be rebuilt -- with the exception of categories (whose creation is extremely time consuming if you have many thousand images). These are gone because they are not stored anywhere else. XMP tags would be a way out, though less than ideal, if they worked. As I've written elsewhere by far the best option would be a text file export facility so that a text file with filename/categories is created which, after recreating the database, can be re-imported.xnview wrote:you would like to recreate the database with categories?
This whole crazy idea of saving the Meta blob is just a desperate attempt to keep the categories safe in case the database has to be rebuilt.
Re: Milking the database for categories
ok, so a way to save in readable way the full category table?jonha4711 wrote:As I've written elsewhere by far the best option would be a text file export facility so that a text file with filename/categories is created which, after recreating the database, can be re-imported.
Pierre.
Re: Milking the database for categories
Yes, the categories as defined for all images in the database, NOT the list categories itself (this is already possible).xnview wrote:ok, so a way to save in readable way the full category table?jonha4711 wrote:As I've written elsewhere by far the best option would be a text file export facility so that a text file with filename/categories is created which, after recreating the database, can be re-imported.
See also http://newsgroup.xnview.com/viewtopic.p ... 21#p131918 and http://newsgroup.xnview.com/viewtopic.p ... 60#p130660