Bibble(tm) catalog maintenance script

The photography software "Bibble", sold under that brand until 2010, has been bought by Corel and is not maintained any more. Those who still use it will no doubt have noticed that bugs can appear over time in their catalogs, especially when the software crash/hangs while manipulating those catalogs. The ultimate solution is to generate Bibble-flavored XMP files for all your images and re-create your catalogs from scratch. Luckily however, there is a simpler (?) way.

First you may wonder why one would still use Bibble, which by now is quite old. One reason is that it's the only professional photo software that runs on Linux. Another one may be that your entire photo database is managed by Bibble. Or that you're just used to the software. Or that you don't like the new version from Corel (whose icons frankly looks like they've been designed by five-year-olds). Maybe you also don't want to pay for the Corel "upgrade", since it's based on the same unbelievably inefficient database format. Many reasons to stay with the good'ol Bibble for now, and yes all those reasons apply to me... :-)

Faced with these issues I ended up writing a python script with the precious advice from a friend (thanks Seb!). The script will clean your catalogs from many forms of errors that Bibble will never correct:

  • Duplicates: for some reason entries can end up being duplicated. This could be pictures, keywords, IPTC data, etc...
  • Conflicts: when an entry is duplicated but has different values you end up with a conflict. Bad!
  • Zombies: some entries are marked for deletion in the database, but are in fact never (?) deleted by Bibble.
  • History: presumably built for the 'undo' feature, the history can end up containing several hundreds of thousands of entries.
  • Zombie keyword paths: some keyword paths are not removed when their last child keyword is removed by the user. This can result in a little boxed '+' sign appearing next to keyword directories with no children (from version 0.3.0)

WARNING: Before running the script, you must backup your catalog. Although I am using this script very regularly and found no problem with it, I still backup my catalogs before running it. You don't want to lose your entire photo database, do you? In fact, back it up twice just to be sure.... If you're confident about the script you can use the -y option when running it: this will answer 'yes' to any prompt (IOW it will run all the cleanups without asking) This '-y' option is only available from version 0.2.2 (Dec. 2016)

The script starts by analyzing your database and finds what errors are present. After confirmation it will solve each class of bug one by one (you can choose the error classes you want to correct). Removing duplicates is the most time-consuming task and it can take several hours to complete, a testament on how inefficient the database format is (presumably my SQL is a bit rusty too...) After performing the modifications the database will be compacted (this can take some time too) and saved.

To run the script go into the catalog you want to clean and run the script there, for example:

cd Catalog_2011
../bibbledbdiag.py

If the script is not executable you can run it with python:

python ../bibbledbdiag.py

Obviously the location of the script could be different, and if it's nicely placed in your PATH you could just run

bibbledbdiag.py

and it will work too. I haven't tested the script on Windows or Mac but there's no reason it shouldn't work, let me know if you have problems there.

There's one other common problem that the script does not solve yet but if you can play with SQLite you can clean it up manually:

  • Some keyword entries show a number of items (e.g. "My Keyword (15)") but there is actually no image showing up for that keyword: go in the "meta" database and try "SELECT * FROM Browse WHERE value="My Keyword" AND implied=0". The number of rows should match the number of zombie keywords (15 in this example). The rows can be deleted.

Oh and obviously this script is provided as-is with no warranty whatsoever ;-) Get it here.