Tool to Check Consistency of Tags
As it has been discussed in this forum (e.g. Group behaviour) that there should be an option to "force" the tags to all grouped or linked images. As the process is today manual, it's prone to errors. This started to annoy me and as I had some free time, I decided to refresh my coding skills and wrote a small Python program that will traverse the Daminion catalog and check for inconsistencies. This is (and probably will stay) as a "nerd version" – you need to be familiar with command line and installing software.
Install Python3 (earlier version should work as well, I have been running on 3.3) and install Psycopg2 package into Python. Now you can run from command line (or from an Python IDE like PyCharm) the attached code. Rename the file first from DamScan.txt to DamScan.py.
C:> Python DamScan.py [options] usage: DamScan.py [-h] [-c DBNAME] [-s SERVER] [-p PORT] [-u USER] [-l] [-v] [--version] optional arguments: -h, --help show this help message and exit -c DBNAME, --catalog DBNAME Daminion catalog name [NetCatalog] -s SERVER, --server SERVER Postgres server [localhost] -p PORT, --port PORT Postgres server port  -u USER, --user USER Postgres user/password [postgres/postgres] -v, --verbose verbose output --version Display version information and exit.
The options should be self evident and the defaults match default Daminion configuration.
Currently the code checks pairwise linked items (not yet grouped) and reports, if there are differences. Program reports the differing files and for single value tags (e.g. Place) it reports both values and for multi value tags (e.g. Keywords) it reports values that are missing from the first file. The output is tab delimited so you paste it into Excel for further processing. The program is read-only; it doesn't change the database contents.
Currently following tags are checked:
- Place (single)
- GPS (single)
- Event (single)
- Keywords (multi)
- Categories (multi)
- People (multi)
An example output:
ImageA Dir ImageB Tag ValueA/Missing A ValueB IMG_8090.jpg <> IMG_8090.CR2 GPS '44.1448N 3.09918E 256.0m' <> '44.1448N 3.09918E 0.0m' IMG_4115.jpg > IMG_4115.CR2 Keywords 'Reflections' IMG_1806.tif < IMG_1806-09.tif Categories 'Other\Panorama'
and an interpretation
- IMG_8090 the GPS co-ordinates (altitude) differ between JPG and CR2
- IMG_4115 the CR2 image has keyword 'Reflections' that is missing from the JPG
- IMG_1806.tif is missing category 'Other\Panorama' that exists in IMG_1806-09.tif
The symbols < and > just show is the relation between the images linked to or from. In both cases (even though the notation can be misleading) ImageB contains tag values that are not existing in ImageA.
I'm thinking of following improvements:
- an option to do the analysis based on stacking instead of linking
- an option to define which tags are analyzed (now all are analyzed)
- option to list the full path and/or the Daminion ID
- write better installation instructions
If you need some other tags to be analyzed or have improvement ideas or problems, drop a note. (GUI is not in my plans. )
The normal disclaimer applies that use it at your own risk, there is no warranty etc. Also I don't take any responsibility if your lover leaves you, because you are just fixing the tagging in your catalog.
Number of downloads: 196