diff options
author | Hung-ying Tyan <tyanh@google.com> | 2012-11-12 22:15:53 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-12 22:15:53 -0800 |
commit | f0d2bbed7be5bcce498eee554a3809a7ce785464 (patch) | |
tree | fe191bbdfc5d0e0f26449bf1659cbc9abc04952b /tests | |
parent | a230880c0313d7e85922e72ec1640d7b34490d3f (diff) | |
parent | 63209dcb6bd21d6c1bf3936bc4a3f04302ec9f42 (diff) | |
download | android_packages_apps_Gallery2-f0d2bbed7be5bcce498eee554a3809a7ce785464.tar.gz android_packages_apps_Gallery2-f0d2bbed7be5bcce498eee554a3809a7ce785464.tar.bz2 android_packages_apps_Gallery2-f0d2bbed7be5bcce498eee554a3809a7ce785464.zip |
Merge "Do not use parentheses for Model tag in exiftool parser" into gb-ub-photos-bryce
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/exiftool_parser/parser.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/exiftool_parser/parser.py b/tests/exiftool_parser/parser.py index 351c1b63c..5de54a352 100755 --- a/tests/exiftool_parser/parser.py +++ b/tests/exiftool_parser/parser.py @@ -63,23 +63,22 @@ for s in tags: ifds.pop() layer = new_layer + # find the ID + _id = re.search("0x[0-9a-f]{4}", s) + _id = _id.group(0) + + # find the name + name = re.search("[0-9]*?\).*? = ", s) + name = name.group(0)[4:-3] + # find the raw value in the parenthesis value = re.search("\(.*\)\n", s) - if value: + if (name != 'Model' and value): value = value.group(0)[1:-2] else: value = re.search("=.*\n", s) value = value.group(0)[2:-1] - # find the ID - p = re.compile("0x[0-9a-f]{4}") - _id = p.search(s) - _id = _id.group(0) - - # find the name - p = re.compile("[0-9]*?\).*? = ") - name = p.search(s) - name = name.group(0)[4:-3] print (' <tag ifd="' + ifds[-1] + '" id="' + _id + '" name="' + name +'">' + value + "</tag>") print "</exif>" |