Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've imported lots of pictures into Shotwell and spent some time setting tags. Are those tags locked-in in Shotwell or I can export them (and import again or use with other software)?

share|improve this question
add comment

5 Answers 5

up vote 12 down vote accepted

I'm the founder of Yorba, makers of Shotwell. Thanks for your question.

Shotwell 0.7 writes metadata (such as tags and titles) to photos when you export them. The metadata is written in EXIF, IPTC and/or XMP format (depending on which of these were present in the photo to begin with). Most other photo programs can read these formats, so if you export your photos from Shotwell then other programs should be able to read their tags with no problem.

The upcoming Shotwell 0.8 can write metadata to photo files on the fly - to enable this, select the option "Write tags, titles and other metadata to photo files" in the preferences dialog. Once this is selected, Shotwell will update metadata in photo files as soon as you tag them. To use this feature, build the Shotwell trunk from source (see http://yorba.org/shotwell/install/#source), or just wait for Shotwell 0.8 (which we plan to release later in December).

share|improve this answer
    
+1 I'm a new user of Shotwell; thanks for all your fine work. –  msw Dec 26 '10 at 2:44
3  
Does the on the fly meta tag writing work retroactive? –  phq Mar 25 '11 at 8:28
add comment

Unfortunately Shotwell does seem to keep the tags in its own database rather than embed them as exif,IPTC or XMP in the pictures, you can check by using exiftool, exiftool can be installed by installing the package libimage-exiftool-perl Install libimage-exiftool-perl , available in the repositories.

See some examples here; http://www.sno.phy.queensu.ca/~phil/exiftool/

use the command; exiftool testpicture.jpg to check a photo called testpicture.jpg that you had previously tagged with Shotwell, you will see that the exiftool output contains no Shotwell tags.

The exiftool utility can tag your pictures embedding the tags in the photo and the good thing about this is that most photo managers will use them, this includes Shotwell. Example:

exiftool -keywords=favourite -keywords=family testpicture.jpg

Replace existing keyword list with two new keywords (favourite and family). When testpicture.jpg is imported into Shotwell the picture will be tagged with favourite and family

It may be helpful to know that the Shotwell database is an sqlite database located in your; ~/.shotwell/data directory, it is usually called photo.db, you can copy it somewhere else on your computer and access it with sqlite

There are a few GUI frontends for sqlite, there is one for firefox here or you can use sqliteman Install sqliteman , both of these front ends have export to csv features, when you export your tags to csv (Comma Separated Values) you can check if any other photo management software will import and map the tags to the appropriate field in their own databases, I believe Digikam can do this. Digikam can also embed exif data in the photos themselves.

Hopefully as Shotwell gain more features this situation will change.

UPDATE: While it is true that Shotwell 0.7 does not store its tags in the pictures as these tags are created, the tags can be embedded in the pictures if you choose to export them, thanks Adam for making this clear. Hopefully this export is lossless when dealing with jpegs. I suspect it is, if one selects original size for the Scaling option in the export dialog.

share|improve this answer
1  
During export if the Scaling option is Original Size and the photo is unedited (no color adjustments, crop, etc.), it's lossless. Note that changing the orientation of a photo is lossless as well, as we use the EXIF flag rather than re-encoding the rotated image. –  Jim Nelson Feb 21 '11 at 20:21
    
Nice to know, thanks –  Sabacon Feb 22 '11 at 15:19
add comment

Quick (dirty?) python code to do this without upgrading Shotwell (I think as of 0.8.x Shotwell can write out tags, but you can't upgrade to that on Lucid). This thing will write out star-ratings as tags (comment that bit out, obviously, if you don't want that).

Requires exiftool. It'll duplicate any tags that are both in the shotwell database AND the images (ie ones that Shotwell imported when it imported the images) so watch out for that. Also, takes quite a while for a big collection of photos.

import os
conn = sqlite3.connect("/home/  username  /.shotwell/data/photo.db")

def get_tags():
    return [ x[0] for x in conn.execute("SELECT name FROM TagTable").fetchall()]

def tag_query(tag):
    return conn.execute("SELECT photo_id_list FROM TagTable WHERE name=?", (tag,)).fetchone()[0].split(",")

def get_tagged_photos(tag):
    for id in tag_query(tag):
        result = conn.execute("select filename from PhotoTable where id=?", (id,) ).fetchone()
        if result:
            yield result[0]

def get_photos_by_rating(rating):
    return [photo[0] for photo in conn.execute("select filename from PhotoTable where rating=?",(rating,)).fetchall()]

def get_tagging_commands():
    commands = []
    for rating in range(1,5):
        for photo in get_photos_by_rating(rating):
             commands.append("exiftool -overwrite_original_in_place -preserve -keywords+=rating%d \"%s\""% (rating,photo))

    for tag in [tag for tag in get_tags() if tag != "keep"]:
        for photo in get_tagged_photos(tag):
             commands.append("exiftool -overwrite_original_in_place -preserve -keywords+=%s \"%s\"" % (tag,photo))

    return commands

commands = get_tagging_commands()
for command in commands:
    print command
    os.system(command)
share|improve this answer
add comment

If you want a really good GUI tool/browser that will let you tag your images using Exif tags (and therefore available in Shotwell too), I recommend jBrout.

I've written about jBrout on my blog.

To install it, go to Synaptic, choose settings/repositories, click on the "Other Software" tab, then hit the "Add" button and paste in this line :

deb http://jbrout.free.fr/download/debian binary/

Then reload and search for jBrout.

share|improve this answer
add comment

Since ~/.shotwell/data/photo.db is identified as photo.db: SQLite 3.x database by file command, I used SQLite Database Browser (sqlitebrowser) to open it.

Hmmm... you can read it :-) It has CVS export feature.

This is not normal GUI approach but there is a way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.