Categories database

Ideas for improvements and requests for new features in XnView Classic

Moderators: helmut, XnTriq, xnview

Post Reply
markus.angerer
Posts: 3
Joined: Thu Oct 05, 2006 12:15 pm

Categories database

Post by markus.angerer »

Hi,

I really like the new categories function in version 1.90! Something that would be nice to have is an Import/Export function for the database so that I could fix invalid filenames in case I moved or renamed the original files.

This would also be handy then moving to another computer that has the same images in a different folder and I don't want to redo the whole categories assignment.

I don't know how complex the database structure in category.db is but either a simple textfile, XML or an Mirosoft Access database would be great.

best regards, Markus


PS. probably same with the ratings. It would be nice if that information could be edited manually and transferred to other PCs.

XnView 1.90
nightflyer
Posts: 98
Joined: Tue Sep 26, 2006 7:41 am

Post by nightflyer »

Database import and export are very important- for correcting database and interoperation with other tools.
The best way is XML, there are free programmer's tools for that.
-=nightflyer=-
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

nightflyer wrote:Database import and export are very important- for correcting database and interoperation with other tools.
The best way is XML, there are free programmer's tools for that.
Do you know free programmer tools?
Pierre.
nightflyer
Posts: 98
Joined: Tue Sep 26, 2006 7:41 am

Post by nightflyer »

I've seen library from this project:
http://xml.apache.org/xerces-c/
in many applications.
Starting page for XML:
http://www.w3.org/XML/
-=nightflyer=-
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France
Contact:

Post by Olivier_G »

While working on XML import/export, please do consider XMP synchronisation with images, as described here.
It may be quite useful (merging Categories management with XMP/IPTC editing).
Olivier
nightflyer
Posts: 98
Joined: Tue Sep 26, 2006 7:41 am

Post by nightflyer »

It is absolutely different matter!
This XML thread is about easy database interoperation.
XMP is about describing images!
-=nightflyer=-
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France
Contact:

Post by Olivier_G »

nightflyer wrote:It is absolutely different matter!
XML and XMP are about data content and are quite similar. My thread was to emphasize the fact that it is possible to synchronise internal DB and Metadata XMP.
I am just asking to keep that in mind while formating the XML Import/Export in order to avoid future issues... nothing more.
I am not asking to implement XMP at the same time... and I agree that my post was slightly out of topic, just slightly. :wink:

edit: I see that my "do consider" was quite vague. Should have said "keep in mind"
Olivier
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France
Contact:

Post by Olivier_G »

XML Import/Export not implemented so far -> Postponed.
Olivier
User avatar
asmodean
Posts: 9
Joined: Mon May 21, 2007 11:44 pm
Contact:

Post by asmodean »

Hi, I registered here to suggest this very thing, but I bothered to search first and found this thread :). I will instead register my agreement with markus.angerer that import/export is a necessity!

Categorizing large amounts data may be a non-trivial investment of time and effort. Many users, myself included, will not do so unless they are sure that the data will not be locked up in a proprietary database. The meta-data needs to be import/export-able to a reasonably neutral format (text/XML/etc) so that it can be moved between applications if necessary.

[This is also a good backup format in case of database corruption.]

I currently use a product called ACDSee which has supported database information for a while. It has a mechanism to import/export the complete database to XML. When I saw XNView had categories now, the first thing I did was hunt around for a way to import data into it, with the intention to export my ACDSee data, convert it to XNView's import format, then importing.

So not having such a feature was disappointing. Since I am experienced reverse engineering data formats, I have been considering writing my own import/export tool for XNView's database ... If you have documentation about the structure you'd like to share, that would be nice.

By the way, in terms of "free xml software", I recommend looking into LibXML2 and LibXML++. These are very functional straightforward XML parsing/producing libraries licensed I believe under LGPL.
User avatar
asmodean
Posts: 9
Joined: Mon May 21, 2007 11:44 pm
Contact:

Post by asmodean »

The import/export can also be useful for you as the XnView developer. If you ever need to modify the database, it could be very painful to be backwards compatible or support migration tools.

If you have generic import/export, then the strategy could be for users to export from the old version before upgrade -- then import into the new version.
markus.angerer
Posts: 3
Joined: Thu Oct 05, 2006 12:15 pm

Post by markus.angerer »

Hi, I've just seen that my thread is still read after that time.

In the meanwhile I found out that the xnview categories database is a SQLite Db which can easily be edited. For a test I used the SQLite ADO.NET 2.0 Provider (http://sourceforge.net/projects/sqlite-dotnet2) which worked perfectly. Even with no database model it is pretty logical to understand that the tables/fields are meant for - still it would be nice if a short description on the db can be made available. Especially in case that changes are made from one version to the next...

For my testing I used MS Visual Studio .NET 2005 at work as it also provides easy functions for XML export. (Visual Sudio Express may also do the job?!) So this would be everything I need but I gave up categorizing in xnview for the moment because of the extremly poor performance of the database when categorizing images.

A little off topic now: I've tried to put 1400 images taken at a 5 megapixel resolution into subsets with around 12 different categories making around 10000 images at all. It takes up to 20 minutes when I try to remove images, 1 minute just to show the images in a category. Starting xnview in the original file system folder to view a single picture also takes 15 seconds before showing the image.
Is this a problem only on my machines or does somebody else experience the same problems? (Hardware is a PentiumD 820, 1 GB Ram).

regards, Markus
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

markus.angerer wrote: A little off topic now: I've tried to put 1400 images taken at a 5 megapixel resolution into subsets with around 12 different categories making around 10000 images at all. It takes up to 20 minutes when I try to remove images, 1 minute just to show the images in a category. Starting xnview in the original file system folder to view a single picture also takes 15 seconds before showing the image.
Is this a problem only on my machines or does somebody else experience the same problems? (Hardware is a PentiumD 820, 1 GB Ram).
20min with the 1.91??
Pierre.
markus.angerer
Posts: 3
Joined: Thu Oct 05, 2006 12:15 pm

Post by markus.angerer »

Sorry, I didn't check for the latest update before complaining! It was 1.90.3 and I just upgraded to 1.91 and it's a lot faster nwo when removing images from a category: 20 sec instead of 20 min!

Markus
marcoswat
Posts: 11
Joined: Mon Apr 06, 2009 11:20 am

Re: Categories database

Post by marcoswat »

I think this is useful too
Post Reply