Updating the location for your photo's in f-spot

I've been using f-spot for quite some time now to manage and categorise all my pictures. In older Ubuntu versions (8.04 and earlier), the default location for f-spot to store its photo's was: /home/username/Photos. For some reason, Ubuntu 10.04 (probably earlier versions as well) changed this folder to: /home/username/Pictures/Photos. I didn't notice this until today, while I was importing photo's and checking the contents of /home/username/Photos only to see nothing was copied to this location. That's when I discovered they changed the default location :)
Since f-spot is backed by an sqlite database, this wasn't very hard to solve:
  • create a backup of the sqlite database photos.db (should be underneath /home/username/.config/f-spot)
  • now update the location with sqlite3:

    kenneth@pavane:/data/home/kenneth/.config/f-spot$ sqlite3 photos.db
    SQLite version 3.6.22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> update photos set base_uri=replace(base_uri, 'file:///home/kenneth/Pictures', 'file:///home/kenneth');
    sqlite> update photo_versions set base_uri=replace(base_uri, 'file:///home/kenneth/Pictures', 'file:///home/kenneth');
    .exit
  • now move your pictures to their correct location

Phew, solved.

Comments

Anonymous said…
thank you very much for this. There are a lot of tricks to do that, but yours is :
- simple, unlike some
- working unlike every other I tested previously.

Popular posts from this blog

Remove copy protection from PDF documents

The story of the Cobalt Qube

Jori Hulkkonen feat. Jerry Valuri - Lo-Fiction