Force Shotwell to Rewrite Metadata

Tags: linux

Shotwell is the first photo organizer that hasn’t made me angry. I’m not a huge photographer, but I’m pretty picky about tools, so that’s saying a lot.

Photos can be tagged and rated, and for a long time those tags and ratings were stored exclusively in the Shotwell database, but the application now allows users to store metadata in Exif and IPTC tags within the photo files for use by other applications. I checked the button, but it looks like shotwell doesn’t automatically go back and write that data for older files.

Shotwell uses SQLite for its metadata storage, so it’s easy to force an update of all your files. Quit Shotwell if it is running, and follow along:

$ pwd
/home/tim/.local/share/shotwell/data
$ cd ~/.local/share/shotwell/data
$ cp photo.db photo.db-justincase
$ sqlite3 photodb

Bash
sqlite> select count(*) from phototable where metadata_dirty=1;
0
sqlite> update phototable set metadata_dirty=1;
sqlite> select count(*) from phototable where metadata_dirty=1;
7917

SQL

Of course the counts will vary depending on the size of your photo collection. Next time you start Shotwell you’ll see it updating metadata: there will be a progress bar displayed below the pane that shows your folders and tags.