The Focal Length Analyzer is a nifty little Bash script that pulls focal length data from digiKam’s database back end and generates nice graphs based on the extracted data.
To perform its magic, the script relies on the sqlite, gnuplot, and imagemagick packages. On Ubuntu and Debian-based distributions, you can install these packages running the apt-get install sqlite3, gnuplot imagemagick command as root. Download then the latest version of the script and make it executable using the chmod o+w focalAnalyzer.sh command. The script accepts two switches: -png and -pdf. Use the -png switch to generate separate graphs for each camera model in the PNG format and the -pdf switch to produce a multi-page PDF file. The script automatically detects whether digiKam uses the SQLite or MySQL database back end, so you don’t need to do anything beyond running the script with the switch you want, for example: ./focalAnalyzer.sh -png
Well, this sounds great, but it does not find the digikam config file and refuses to run:
$ ./focalAnalyzer.sh -pdf
Cannot find Digikam config file (digikamrc)
I have to add that it does work, if I remove the entire if & else clause around the line
DIGIKAMRC=$HOME/.kde/share/config/digikamrc
It seems that, for some reason, while kde-config is available, it does not point to the correct directory?
Nifty script, btw. Thanks a lot for it, it will prove very useful.
This promises to be very useful, but I can not run the script.
$ ./focalAnalyzer.sh -pdf
./focalAnalyzer.sh: line 62: [: ==: unary operator expected
./focalAnalyzer.sh: line 67: [: ==: unary operator expected
./focalAnalyzer.sh: line 86: select distinct model from ImageMetadata: command not found
It seems that there is a syntax error? The lines in question are:
62: if [ $DBTYPE == “QSQLITE” ]; then
67: elif [ $DBTYPE == “QMYSQL” ]; then
86: $SQLCOMMAND ‘select distinct model from ImageMetadata’ >$MODELS # List of identified camera models
Note: I’m running openSuse 11.4 with digikam 1.8 version. The database type is QSQLITE
Same issue as hehe23 on PCLinuxOS 2011.6
The script would be a nice addition to Digikam, but it hangs at the mktemp command:
$ myscripts/focalAnalyzer.sh -png
Backend is SQLite
mktemp: invalid option — ‘-‘
Usage: mktemp [-V] | [-dqtu] [-p prefix] [template]
myscripts/focalAnalyzer.sh: line 88: $MODELS: ambiguous redirect
sed: no input files
Even if I modify the script changing the arguments after ‘mktemp’ the temp file can still not be created.
Any tips to get this to work?