Copy/backup catalog info by folder

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, xnview

lalaka
Posts: 11
Joined: Tue Oct 10, 2006 9:27 pm

Copy/backup catalog info by folder

Postby lalaka » Sat Jul 22, 2017 8:03 pm

Is it possible to somehow copy (rather than move) catalog info to another folder (e.g. backup folder on NAS)?

I keep backups of my images on another location which is not permanently accessible for XnView (i.e. on a NAS or external hard drive). When moving or copying images there, I would also like to keep the info stored in the catalog, especially ratings which are not available otherwise.
I did find the option to move catalog data, but that doesn't help for just copying (not moving) the files.

CameronD
Posts: 286
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: Copy/backup catalog info by folder

Postby CameronD » Sun Jul 23, 2017 2:18 am

You can (and I strongly recommend) writing the ratings metadata to the image file (or a sidecar according to your preference). (See Settings->metadata).
That way, you can reconstruct your DB should it every become lost/corrupted.

As far as I know you would need to manipulate the database file yourself to achieve what you want. That requires you know how to write SQL statements.

lalaka
Posts: 11
Joined: Tue Oct 10, 2006 9:27 pm

Re: Copy/backup catalog info by folder

Postby lalaka » Mon Jul 24, 2017 8:53 pm

You can (and I strongly recommend) writing the ratings metadata to the image file (or a sidecar according to your preference).

I guess this is a "all or nothing" decision - use XMP inside the image or in a sidecar?
Or could I write some XMP info into the image file while having other parts being written to the sidecar?

Because I consider most XMP info as relevant to the image independently and thus still meaningful when an individual image is moved somewhere - good reason to store in the file itself. On the other hand I don't use ratings globally but relatively in a folder of images (project, individual vacation, ...), so they become meaningless for an individual file - reason for rather putting that info into a sidecar.

As far as I know you would need to manipulate the database file yourself to achieve what you want. That requires you know how to write SQL statements.

Well, a bit of SQL(ite) magic wouldn't scare me off. Unfortunately metadata in the catalog seems to be serialized in some binary form, not readable directly as dedicated attributes in specific columns, so extracting anything is not possible without knowing the serialized data structure.
Anyway, without being documented that would be a fragile approach. As a developer, I myself would discourage it and make no guarantees for the DB schema os data structure to stay the same.

CameronD
Posts: 286
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: Copy/backup catalog info by folder

Postby CameronD » Tue Jul 25, 2017 1:19 am

lalaka wrote:I guess this is a "all or nothing" decision - use XMP inside the image or in a sidecar?
Or could I write some XMP info into the image file while having other parts being written to the sidecar?

Not that I am aware of. You could keep some info as IPTC in the image file but I think all XMP must be in one place - at least as far as XnViewMP is concerned, I don't know about the standard.

Because I consider most XMP info as relevant to the image independently and thus still meaningful when an individual image is moved somewhere - good reason to store in the file itself. On the other hand I don't use ratings globally but relatively in a folder of images (project, individual vacation, ...), so they become meaningless for an individual file - reason for rather putting that info into a sidecar.

I'm getting a bit confused about what problem you are trying to solve. Do you have multiple copies online but only a single backup? I tend to backup entire folders anyway but I don't often duplicate image files.

Well, a bit of SQL(ite) magic wouldn't scare me off. Unfortunately metadata in the catalog seems to be serialized in some binary form,

The ratings and colour are the only metadata stored as separate items. However, I was thinking along the lines of altering folder names or possibly duplicating image entries, but then you could simply achieve the same thing by using xnviewMP itself to copy the image to your backup.

lalaka
Posts: 11
Joined: Tue Oct 10, 2006 9:27 pm

Re: Copy/backup catalog info by folder

Postby lalaka » Tue Jul 25, 2017 8:45 pm

I'm getting a bit confused about what problem you are trying to solve. Do you have multiple copies online but only a single backup? I tend to backup entire folders anyway but I don't often duplicate image files.

Sorry, I indeed had two different use cases in mind without making it clear:

A) Ratings relating to the complete set of images in a folder. I use that rating for example to create selections for a slideshow made from images from that folder. When I make a backup of that folder, I'd like to store those ratings, too. Storing in the image file itself is preferred in this case.

B) Sometimes I create a compilation of images from various folders. For that I copy those images to a new folder (in fact, I'd rather create links to the original images in the compilation folder), and I may use ratings again. In that case I don't want to interfere with the original rating and I also wouldn't want to change image file contents, so those duplicates could also be found later on without having to rely on the slow comparison of image data. Storing another rating in a sidecar or the catalog only would be preferred in this case.

For now I will just work as follows:
  • enable storing ratings in XMP inside the images, this covers the backup scenario.
  • as long as I need to make copies for compilations anyway, I will just have to delete all ratings in the compilation folder first if I need to use ratings on the compilation again.
  • for creating compilations I just found a workflow which leverages the (for me new) fact that the checked state (DB "album") is persisted in the catalog, too. Folder by folder: select images (maybe by rating), check them; when done: go to global filter by checked state, copy them all to new compilation folder; optional: reset rating of copies, use ratings again in compilation.

The compilation use case B) would greatly benefit from albums as described here. But then again, while avoiding image copies, the rating issue would even be worse...

Thanks for the hint regarding the options for storing rating/color info in XMP!

BTW: I looked into the wrong DB at first (Thumbs.db), I now found the rating info in XnView.db

CameronD
Posts: 286
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: Copy/backup catalog info by folder

Postby CameronD » Wed Jul 26, 2017 2:14 am

lalaka wrote:...
The compilation use case B) would greatly benefit from albums as described here. But then again, while avoiding image copies, the rating issue would even be worse...


The current lack of album implementation in xnview is one of the reasons that I keep using Picasa.

I then use Picasa's export to create the copy and I might also adjust max resolution and sometimes crop differently to suit the target purpose.
The images also often get named differently to fix the order of display.

I think using links would eventually lead to problems where, unless you are being very careful, one image file would be out of sync with the DB, because afaik the DB always treats them as two separate files.


Return to “MP - General Support”

Who is online

Users browsing this forum: No registered users and 1 guest