Requirements

Python with MySQL and TagLib bindings. These are available on Ubuntu systems as python-mysqldb and python-tagpy respectively.
mysqld.

Usage

Simply run the script from anywhere. It will copy your Amarok database to /tmp, start a MySQL daemon on the copied database, create the cover.jpg files in your collection and print some statistics.

The collection location is pulled from the database. It assumes that your Amarok database is stored in the usual location, i.e. ~/.kde/share/apps/amarok/mysqle (.kde4 is also checked). It assumes the collection has one album per folder, and will not overwrite files.