From 39b3722a11483b0f1322986528e77d01b4c92183 Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Sun, 15 Nov 2009 08:17:38 +0000 Subject: New beta release --- rapid/metadata.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'rapid/metadata.py') diff --git a/rapid/metadata.py b/rapid/metadata.py index 8fc6820..1d4b2df 100755 --- a/rapid/metadata.py +++ b/rapid/metadata.py @@ -220,11 +220,13 @@ class MetaData(pyexiv2.Image): Returns missing if the metadata value is not present. - The short format is determined by the first occurence of a digit in the + The short format is determined by the first occurrence of a digit in the camera model, including all alphaNumeric characters before and after - that digit up till a non-alphanumeric character. + that digit up till a non-alphanumeric character, but with these interventions: - Canon "Mark" designations are shortened prior to conversion. + 1. Canon "Mark" designations are shortened prior to conversion. + 2. Names like "Canon EOS DIGITAL REBEL XSi" do not have a number and must + and treated differently (see below) Examples: Canon EOS 300D DIGITAL -> 300D @@ -233,6 +235,20 @@ class MetaData(pyexiv2.Image): NIKON D2X -> D2X NIKON D70 -> D70 X100,D540Z,C310Z -> X100 + Canon EOS DIGITAL REBEL XSi -> XSi + Canon EOS Digital Rebel XS -> XS + Canon EOS Digital Rebel XTi -> XTi + Canon EOS Kiss Digital X -> Digital + Canon EOS Digital Rebel XT -> XT + EOS Kiss Digital -> Digital + Canon Digital IXUS Wireless -> Wireless + Canon Digital IXUS i zoom -> zoom + Canon EOS Kiss Digital N -> N + Canon Digital IXUS IIs -> IIs + IXY Digital L -> L + Digital IXUS i -> i + IXY Digital -> Digital + Digital IXUS -> IXUS The optional includeCharacters allows additional characters to appear before and after the digits. @@ -246,8 +262,7 @@ class MetaData(pyexiv2.Image): includeCharacters = '\-': DSC-P92 -> DSC-P92 - If a digit is not found in the camera model, the full length camera - model is returned. + If a digit is not found in the camera model, the last word is returned. Note: assume exif values are in ENGLISH, regardless of current platform """ @@ -260,7 +275,8 @@ class MetaData(pyexiv2.Image): if r: return r.group("model") else: - return m.strip() + head, space, model = m.strip().rpartition(' ') + return model else: return missing -- cgit v1.2.3