Re: Meta-Data Import



Gabriel Burt wrote:
I don't know of anybody working on that.  You might look at my gThumb
metadata import patch (sent to the list a few weeks ago) if you need
help getting started.

Ok - I've written up a brief description of what I want to do. I might start implementing it this weekend - since I'm quite interested in getting my photos and metadata off my ibook and into F-spot.

Any feedback would be very welcome. If I don't get any feedback in the next day or so, I'll add an enhancement request for it to bugzilla.


The goal of this addition is to allow the easy importing of arbitrary image metadata - primarily categories and ratings - from other programs into f-spot. The general approach will be to create an xml file describing the metadata to be added to each photo - and to add an 'Import Metadata..." option to f-spot that parses the XML, tries to find the appropriate photo(s) and add the metadata to it. The xml data will look like this:

<photos>
  <photo name="IMG_1938.jpg" date="March 10, 2006">
    <category> San Francisco </category>
    <category> /people/Fred </category>
    <category> /Events/MacWorld/Mac World 2006 </category>
    <rating> 5 </rating>
  </photo>
</photos>

The name attribute on the photo element is required - the date is optional. If multiple images with a matching name exist, and a date is specified, then each specified date matches any of the images with a same name, the metadata is applied to the first such matching image found. If multiple images have the same name and date - it is arbitrary which image is selected.

When a matching photo is found, the list of category subelements is processed - for each category we first try to find an existing category or tag. - if the first character is the category name is a '/', then any internal '/' characters are used to separate parent categories from children categories - so "/Events/MacWorld/Mac World 2006" would look for a top level category "Events" with a child category "MacWorld", which has a child category or tag "Mac World 2006". If the categories or tags don't exist , they are created.

Category names without a leading '/' are treated as single names, even if there is an internal '/' - so "Burning Man / Black Rock City" is treated as a single 'relative' category name. When a relative category name is encoutered, the import process checks to see if it can find an existing category or tag with that name, anywhere in the Category tree - if it can, the first one it finds is used. If no matching categories or tags are found anywhere, then a new category is created as a child of the top-level Category "Imported Tags" - which is created if it doesn't exist.

If a 'rating' sub-element is found, it is assumed to contain an integral value, and a rating of that many 'stars' is applied to the photo.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]