Scribbles and Snaps

Linux, Open Source, Photography

Use the Focal Length Analyzer Script with digiKam

with 6 comments

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

Written by Dmitri Popov

2011/08/08 at 08:46

6 Responses

Subscribe to comments with RSS.

  1. 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)

    mutlu

    2011/08/09 at 08:44

  2. 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?

    mutlu

    2011/08/09 at 12:24

  3. Nifty script, btw. Thanks a lot for it, it will prove very useful.

    mutlu

    2011/08/09 at 12:25

  4. 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

    hehe23

    2011/08/26 at 18:56

  5. Same issue as hehe23 on PCLinuxOS 2011.6

    Mike Bing

    2011/08/29 at 21:18

  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?

    Leon

    2011/09/04 at 23:55


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 374 other followers

%d bloggers like this: