Page 1 of 1
Milking the database for categories
Posted: Sat May 14, 2016 10:51 am
by jonha4711
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.
Re: Milking the database for categories
Posted: Tue May 17, 2016 8:35 am
by xnview
no XnViewMP read metadata, and create entries in category table
Re: Milking the database for categories
Posted: Tue May 17, 2016 9:26 am
by jonha4711
xnview wrote:no XnViewMP read metadata, and create entries in category table
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.)
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
Posted: Tue May 17, 2016 11:05 am
by xnview
a problem of sync between metadata and categories
Re: Milking the database for categories
Posted: Tue May 17, 2016 12:15 pm
by jonha4711
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.
Re: Milking the database for categories
Posted: Tue May 17, 2016 4:10 pm
by xnview
you would like to recreate the database with categories?
Re: Milking the database for categories
Posted: Tue May 17, 2016 4:46 pm
by jonha4711
xnview wrote:you would like to recreate the database with 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.
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
Posted: Wed May 18, 2016 6:56 am
by xnview
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.
ok, so a way to save in readable way the full category table?
Re: Milking the database for categories
Posted: Wed May 18, 2016 11:18 am
by jonha4711
xnview wrote: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.
ok, so a way to save in readable way the full category table?
Yes, the categories as defined for all images in the database, NOT the list categories itself (this is already possible).
See also
http://newsgroup.xnview.com/viewtopic.p ... 21#p131918 and
http://newsgroup.xnview.com/viewtopic.p ... 60#p130660
Re: Milking the database for categories
Posted: Tue May 31, 2016 1:09 pm
by xnview
could you contact me by PM