annotate MoinMoin/filter/EXIF.py @ 4729:2a55ba43afb3

filter.EXIF: reduce renamed to reduce_size (avoid name clash)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 08 May 2009 20:01:57 +0200
parents 7028ac728357
children
rev   line source
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1 #!/usr/bin/env python
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
2 # -*- coding: utf-8 -*-
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
3 #
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4 # Library to extract EXIF information in digital camera image files
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
5 # http://sourceforge.net/projects/exif-py/
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
6 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
7 # To use this library call with:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
8 # f=open(path_name, 'rb')
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9 # tags=EXIF.process_file(f)
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
10 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
11 # If you want to ignore makerNote, pass the -q or --quick
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
12 # command line arguments, or as
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
13 # tags=EXIF.process_file(f, details=False)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
14 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
15 # This is useful when you are retrieving a large list of images
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
16 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
17 # Returned tags will be a dictionary mapping names of EXIF tags to their
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
18 # values in the file named by path_name. You can process the tags
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
19 # as you wish. In particular, you can iterate through all the tags with:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
20 # for tag in tags.keys():
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
21 # if tag not in ('JPEGThumbnail', 'TIFFThumbnail', 'Filename',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
22 # 'EXIF MakerNote'):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
23 # print "Key: %s, value %s" % (tag, tags[tag])
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
24 # (This code uses the if statement to avoid printing out a few of the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
25 # tags that tend to be long or boring.)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
26 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
27 # The tags dictionary will include keys for all of the usual EXIF
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
28 # tags, and will also include keys for Makernotes used by some
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
29 # cameras, for which we have a good specification.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
30 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
31 # Contains code from "exifdump.py" originally written by Thierry Bousch
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
32 # <bousch@topo.math.u-psud.fr> and released into the public domain.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
33 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
34 # Updated and turned into general-purpose library by Gene Cash
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
35 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
36 # This copyright license is intended to be similar to the FreeBSD license.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
37 #
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
38 # Copyright (c) 2002 Gene Cash All rights reserved.
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
39 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
40 # Redistribution and use in source and binary forms, with or without
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
41 # modification, are permitted provided that the following conditions are
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
42 # met:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
43 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
44 # 1. Redistributions of source code must retain the above copyright
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
45 # notice, this list of conditions and the following disclaimer.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
46 # 2. Redistributions in binary form must reproduce the above copyright
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
47 # notice, this list of conditions and the following disclaimer in the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
48 # documentation and/or other materials provided with the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
49 # distribution.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
50 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
51 # THIS SOFTWARE IS PROVIDED BY GENE CASH ``AS IS'' AND ANY EXPRESS OR
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
52 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
53 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
54 # DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
55 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
56 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
57 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
58 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
59 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
60 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
61 # POSSIBILITY OF SUCH DAMAGE.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
62 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
63 # This means you may do anything you want with this code, except claim you
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
64 # wrote it. Also, if it breaks you get to keep both pieces.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
65 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
66 # Patch Contributors:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
67 # * Simon J. Gerraty <sjg@crufty.net>
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
68 # s2n fix & orientation decode
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
69 # * John T. Riedl <riedl@cs.umn.edu>
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
70 # Added support for newer Nikon type 3 Makernote format for D70 and some
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
71 # other Nikon cameras.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
72 # * Joerg Schaefer <schaeferj@gmx.net>
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
73 # Fixed subtle bug when faking an EXIF header, which affected maker notes
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
74 # using relative offsets, and a fix for Nikon D100.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
75 #
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
76 # 1999-08-21 TB Last update by Thierry Bousch to his code.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
77 # 2002-01-17 CEC Discovered code on web.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
78 # Commented everything.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
79 # Made small code improvements.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
80 # Reformatted for readability.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
81 # 2002-01-19 CEC Added ability to read TIFFs and JFIF-format JPEGs.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
82 # Added ability to extract JPEG formatted thumbnail.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
83 # Added ability to read GPS IFD (not tested).
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
84 # Converted IFD data structure to dictionaries indexed by
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
85 # tag name.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
86 # Factored into library returning dictionary of IFDs plus
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
87 # thumbnail, if any.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
88 # 2002-01-20 CEC Added MakerNote processing logic.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
89 # Added Olympus MakerNote.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
90 # Converted data structure to single-level dictionary, avoiding
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
91 # tag name collisions by prefixing with IFD name. This makes
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
92 # it much easier to use.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
93 # 2002-01-23 CEC Trimmed nulls from end of string values.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
94 # 2002-01-25 CEC Discovered JPEG thumbnail in Olympus TIFF MakerNote.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
95 # 2002-01-26 CEC Added ability to extract TIFF thumbnails.
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
96 # Added Nikon, Fujifilm, Casio MakerNotes.
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
97 # 2003-11-30 CEC Fixed problem with canon_decode_tag() not creating an
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
98 # IFD_Tag() object.
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
99 # 2004-02-15 CEC Finally fixed bit shift warning by converting Y to 0L.
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
100 #
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
101 # ---------------------------- End original notices ------------------------- #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
102
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
103 # 2006-08-04 MoinMoin:ReimarBauer
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
104 # added an optional parameter name to process_file and dump_IFD. Using this parameter the
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
105 # loop is breaked after that tag_name is processed.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
106 # Example:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
107 # f = open(infile, 'rb')
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
108 # tags = EXIF.process_file(f,'DateTimeOriginal')
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
109 # f.close()
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
110 # some PEP8 changes
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
111
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
112 # 2007-01-18 - Ianaré Sévi <ianare@gmail.com>
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
113 # Fixed a couple errors and assuming maintenance of the library.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
114
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
115 # 2007-03-24 - Ianaré Sévi
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
116 # Can now ignore MakerNotes Tags for faster processing.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
117
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
118 # 2007-05-03 - Martin Stone <mj_stone@users.sourceforge.net>
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
119 # Fix for inverted detailed flag and Photoshop header
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
120
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
121 # 2007-09-22 - Stephen H. Olson
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
122 # Don't error on invalid string
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
123 # Improved Nikon MakerNote support
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
124
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
125 # 2007-09-26 - Stephen H. Olson
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
126 # Don't error on invalid Olympus 'SpecialMode'.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
127 # Add a few more Olympus/Minolta tags.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
128
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
129 # 2007-09-27 - Ianaré Sévi
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
130 # Add Olympus Makernote tags.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
131
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
132
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
133 # ===== CODE START ==== #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
134
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
135 # Don't throw an exception when given an out of range character.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
136 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
137 # lambda x: ''.join(map(chr, x))
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
138 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
139 def make_string(seq):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
140 str = ""
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
141 for c in seq:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
142 # Screen out non-printing characters
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
143 if 32 <= c and c < 256:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
144 str += chr(c)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
145 # If no printing chars
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
146 if not str:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
147 return seq
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
148 return str
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
149
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
150 # Special version to deal with the code in the first 8 bytes of a user comment.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
151 def make_string_uc(seq):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
152 code = seq[0:8]
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
153 seq = seq[8:]
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
154 # Of course, this is only correct if ASCII, and the standard explicitly
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
155 # allows JIS and Unicode.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
156 return make_string(seq)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
157
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
158 # field type descriptions as (length, abbreviation, full name) tuples
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
159 FIELD_TYPES = (
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
160 (0, 'X', 'Proprietary'), # no such type
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
161 (1, 'B', 'Byte'),
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
162 (1, 'A', 'ASCII'),
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
163 (2, 'S', 'Short'),
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
164 (4, 'L', 'Long'),
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
165 (8, 'R', 'Ratio'),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
166 (1, 'SB', 'Signed Byte'),
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
167 (1, 'U', 'Undefined'),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
168 (2, 'SS', 'Signed Short'),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
169 (4, 'SL', 'Signed Long'),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
170 (8, 'SR', 'Signed Ratio'),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
171 )
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
172
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
173 # dictionary of main EXIF tag names
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
174 # first element of tuple is tag name, optional second element is
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
175 # another dictionary giving names to values
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
176 EXIF_TAGS = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
177 0x0100: ('ImageWidth', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
178 0x0101: ('ImageLength', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
179 0x0102: ('BitsPerSample', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
180 0x0103: ('Compression',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
181 {1: 'Uncompressed TIFF',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
182 6: 'JPEG Compressed'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
183 0x0106: ('PhotometricInterpretation', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
184 0x010A: ('FillOrder', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
185 0x010D: ('DocumentName', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
186 0x010E: ('ImageDescription', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
187 0x010F: ('Make', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
188 0x0110: ('Model', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
189 0x0111: ('StripOffsets', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
190 0x0112: ('Orientation',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
191 {1: 'Horizontal (normal)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
192 2: 'Mirrored horizontal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
193 3: 'Rotated 180',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
194 4: 'Mirrored vertical',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
195 5: 'Mirrored horizontal then rotated 90 CCW',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
196 6: 'Rotated 90 CW',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
197 7: 'Mirrored horizontal then rotated 90 CW',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
198 8: 'Rotated 90 CCW'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
199 0x0115: ('SamplesPerPixel', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
200 0x0116: ('RowsPerStrip', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
201 0x0117: ('StripByteCounts', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
202 0x011A: ('XResolution', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
203 0x011B: ('YResolution', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
204 0x011C: ('PlanarConfiguration', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
205 0x0128: ('ResolutionUnit',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
206 {1: 'Not Absolute',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
207 2: 'Pixels/Inch',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
208 3: 'Pixels/Centimeter'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
209 0x012D: ('TransferFunction', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
210 0x0131: ('Software', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
211 0x0132: ('DateTime', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
212 0x013B: ('Artist', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
213 0x013E: ('WhitePoint', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
214 0x013F: ('PrimaryChromaticities', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
215 0x0156: ('TransferRange', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
216 0x0200: ('JPEGProc', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
217 0x0201: ('JPEGInterchangeFormat', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
218 0x0202: ('JPEGInterchangeFormatLength', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
219 0x0211: ('YCbCrCoefficients', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
220 0x0212: ('YCbCrSubSampling', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
221 0x0213: ('YCbCrPositioning', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
222 0x0214: ('ReferenceBlackWhite', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
223 0x828D: ('CFARepeatPatternDim', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
224 0x828E: ('CFAPattern', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
225 0x828F: ('BatteryLevel', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
226 0x8298: ('Copyright', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
227 0x829A: ('ExposureTime', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
228 0x829D: ('FNumber', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
229 0x83BB: ('IPTC/NAA', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
230 0x8769: ('ExifOffset', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
231 0x8773: ('InterColorProfile', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
232 0x8822: ('ExposureProgram',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
233 {0: 'Unidentified',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
234 1: 'Manual',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
235 2: 'Program Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
236 3: 'Aperture Priority',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
237 4: 'Shutter Priority',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
238 5: 'Program Creative',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
239 6: 'Program Action',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
240 7: 'Portrait Mode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
241 8: 'Landscape Mode'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
242 0x8824: ('SpectralSensitivity', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
243 0x8825: ('GPSInfo', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
244 0x8827: ('ISOSpeedRatings', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
245 0x8828: ('OECF', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
246 # print as string
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
247 0x9000: ('ExifVersion', make_string),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
248 0x9003: ('DateTimeOriginal', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
249 0x9004: ('DateTimeDigitized', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
250 0x9101: ('ComponentsConfiguration',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
251 {0: '',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
252 1: 'Y',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
253 2: 'Cb',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
254 3: 'Cr',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
255 4: 'Red',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
256 5: 'Green',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
257 6: 'Blue'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
258 0x9102: ('CompressedBitsPerPixel', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
259 0x9201: ('ShutterSpeedValue', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
260 0x9202: ('ApertureValue', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
261 0x9203: ('BrightnessValue', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
262 0x9204: ('ExposureBiasValue', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
263 0x9205: ('MaxApertureValue', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
264 0x9206: ('SubjectDistance', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
265 0x9207: ('MeteringMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
266 {0: 'Unidentified',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
267 1: 'Average',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
268 2: 'CenterWeightedAverage',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
269 3: 'Spot',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
270 4: 'MultiSpot'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
271 0x9208: ('LightSource',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
272 {0: 'Unknown',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
273 1: 'Daylight',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
274 2: 'Fluorescent',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
275 3: 'Tungsten',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
276 10: 'Flash',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
277 17: 'Standard Light A',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
278 18: 'Standard Light B',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
279 19: 'Standard Light C',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
280 20: 'D55',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
281 21: 'D65',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
282 22: 'D75',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
283 255: 'Other'}),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
284 0x9209: ('Flash', {0: 'No',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
285 1: 'Fired',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
286 5: 'Fired (?)', # no return sensed
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
287 7: 'Fired (!)', # return sensed
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
288 9: 'Fill Fired',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
289 13: 'Fill Fired (?)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
290 15: 'Fill Fired (!)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
291 16: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
292 24: 'Auto Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
293 25: 'Auto Fired',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
294 29: 'Auto Fired (?)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
295 31: 'Auto Fired (!)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
296 32: 'Not Available'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
297 0x920A: ('FocalLength', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
298 0x9214: ('SubjectArea', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
299 0x927C: ('MakerNote', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
300 # print as string
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
301 0x9286: ('UserComment', make_string_uc), # First 8 bytes gives coding system e.g. ASCII vs. JIS vs Unicode
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
302 0x9290: ('SubSecTime', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
303 0x9291: ('SubSecTimeOriginal', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
304 0x9292: ('SubSecTimeDigitized', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
305 # print as string
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
306 0xA000: ('FlashPixVersion', make_string),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
307 0xA001: ('ColorSpace', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
308 0xA002: ('ExifImageWidth', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
309 0xA003: ('ExifImageLength', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
310 0xA005: ('InteroperabilityOffset', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
311 0xA20B: ('FlashEnergy', ), # 0x920B in TIFF/EP
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
312 0xA20C: ('SpatialFrequencyResponse', ), # 0x920C - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
313 0xA20E: ('FocalPlaneXResolution', ), # 0x920E - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
314 0xA20F: ('FocalPlaneYResolution', ), # 0x920F - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
315 0xA210: ('FocalPlaneResolutionUnit', ), # 0x9210 - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
316 0xA214: ('SubjectLocation', ), # 0x9214 - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
317 0xA215: ('ExposureIndex', ), # 0x9215 - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
318 0xA217: ('SensingMethod', ), # 0x9217 - -
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
319 0xA300: ('FileSource',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
320 {3: 'Digital Camera'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
321 0xA301: ('SceneType',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
322 {1: 'Directly Photographed'}),
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1993
diff changeset
323 0xA302: ('CVAPattern', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
324 0xA401: ('CustomRendered', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
325 0xA402: ('ExposureMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
326 {0: 'Auto Exposure',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
327 1: 'Manual Exposure',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
328 2: 'Auto Bracket'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
329 0xA403: ('WhiteBalance',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
330 {0: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
331 1: 'Manual'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
332 0xA404: ('DigitalZoomRatio', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
333 0xA405: ('FocalLengthIn35mm', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
334 0xA406: ('SceneCaptureType', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
335 0xA407: ('GainControl', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
336 0xA408: ('Contrast', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
337 0xA409: ('Saturation', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
338 0xA40A: ('Sharpness', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
339 0xA40C: ('SubjectDistanceRange', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
340 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
341
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
342 # interoperability tags
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
343 INTR_TAGS = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
344 0x0001: ('InteroperabilityIndex', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
345 0x0002: ('InteroperabilityVersion', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
346 0x1000: ('RelatedImageFileFormat', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
347 0x1001: ('RelatedImageWidth', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
348 0x1002: ('RelatedImageLength', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
349 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
350
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
351 # GPS tags (not used yet, haven't seen camera with GPS)
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
352 GPS_TAGS = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
353 0x0000: ('GPSVersionID', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
354 0x0001: ('GPSLatitudeRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
355 0x0002: ('GPSLatitude', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
356 0x0003: ('GPSLongitudeRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
357 0x0004: ('GPSLongitude', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
358 0x0005: ('GPSAltitudeRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
359 0x0006: ('GPSAltitude', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
360 0x0007: ('GPSTimeStamp', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
361 0x0008: ('GPSSatellites', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
362 0x0009: ('GPSStatus', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
363 0x000A: ('GPSMeasureMode', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
364 0x000B: ('GPSDOP', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
365 0x000C: ('GPSSpeedRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
366 0x000D: ('GPSSpeed', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
367 0x000E: ('GPSTrackRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
368 0x000F: ('GPSTrack', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
369 0x0010: ('GPSImgDirectionRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
370 0x0011: ('GPSImgDirection', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
371 0x0012: ('GPSMapDatum', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
372 0x0013: ('GPSDestLatitudeRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
373 0x0014: ('GPSDestLatitude', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
374 0x0015: ('GPSDestLongitudeRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
375 0x0016: ('GPSDestLongitude', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
376 0x0017: ('GPSDestBearingRef', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
377 0x0018: ('GPSDestBearing', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
378 0x0019: ('GPSDestDistanceRef', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
379 0x001A: ('GPSDestDistance', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
380 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
381
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
382 # ignore these tags when quick processing
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
383 # 0x927C is MakerNote Tags
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
384 # 0x9286 is user comment
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
385 IGNORE_TAGS=(0x9286, 0x927C)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
386
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
387 # http://tomtia.plala.jp/DigitalCamera/MakerNote/index.asp
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
388 def nikon_ev_bias(seq):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
389 # First digit seems to be in steps of 1/6 EV.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
390 # Does the third value mean the step size? It is usually 6,
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
391 # but it is 12 for the ExposureDifference.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
392 #
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
393 if seq == [252, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
394 return "-2/3 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
395 if seq == [253, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
396 return "-1/2 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
397 if seq == [254, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
398 return "-1/3 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
399 if seq == [0, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
400 return "0 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
401 if seq == [2, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
402 return "+1/3 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
403 if seq == [3, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
404 return "+1/2 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
405 if seq == [4, 1, 6, 0]:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
406 return "+2/3 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
407 # Handle combinations not in the table.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
408 a = seq[0]
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
409 # Causes headaches for the +/- logic, so special case it.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
410 if a == 0:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
411 return "0 EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
412 if a > 127:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
413 a = 256 - a
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
414 ret_str = "-"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
415 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
416 ret_str = "+"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
417 b = seq[2] # Assume third value means the step size
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
418 whole = a / b
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
419 a = a % b
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
420 if whole != 0:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
421 ret_str = ret_str + str(whole) + " "
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
422 if a == 0:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
423 ret_str = ret_str + "EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
424 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
425 r = Ratio(a, b)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
426 ret_str = ret_str + r.__repr__() + " EV"
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
427 return ret_str
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
428
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
429 # Nikon E99x MakerNote Tags
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
430 MAKERNOTE_NIKON_NEWER_TAGS={
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
431 0x0001: ('MakernoteVersion', make_string), # Sometimes binary
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
432 0x0002: ('ISOSetting', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
433 0x0003: ('ColorMode', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
434 0x0004: ('Quality', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
435 0x0005: ('Whitebalance', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
436 0x0006: ('ImageSharpening', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
437 0x0007: ('FocusMode', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
438 0x0008: ('FlashSetting', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
439 0x0009: ('AutoFlashMode', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
440 0x000B: ('WhiteBalanceBias', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
441 0x000C: ('WhiteBalanceRBCoeff', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
442 0x000D: ('ProgramShift', nikon_ev_bias),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
443 # Nearly the same as the other EV vals, but step size is 1/12 EV (?)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
444 0x000E: ('ExposureDifference', nikon_ev_bias),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
445 0x000F: ('ISOSelection', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
446 0x0011: ('NikonPreview', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
447 0x0012: ('FlashCompensation', nikon_ev_bias),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
448 0x0013: ('ISOSpeedRequested', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
449 0x0016: ('PhotoCornerCoordinates', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
450 # 0x0017: Unknown, but most likely an EV value
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
451 0x0018: ('FlashBracketCompensationApplied', nikon_ev_bias),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
452 0x0019: ('AEBracketCompensationApplied', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
453 0x001A: ('ImageProcessing', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
454 0x0080: ('ImageAdjustment', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
455 0x0081: ('ToneCompensation', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
456 0x0082: ('AuxiliaryLens', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
457 0x0083: ('LensType', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
458 0x0084: ('LensMinMaxFocalMaxAperture', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
459 0x0085: ('ManualFocusDistance', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
460 0x0086: ('DigitalZoomFactor', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
461 0x0087: ('FlashMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
462 {0x00: 'Did Not Fire',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
463 0x01: 'Fired, Manual',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
464 0x07: 'Fired, External',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
465 0x08: 'Fired, Commander Mode ',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
466 0x09: 'Fired, TTL Mode'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
467 0x0088: ('AFFocusPosition',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
468 {0x0000: 'Center',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
469 0x0100: 'Top',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
470 0x0200: 'Bottom',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
471 0x0300: 'Left',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
472 0x0400: 'Right'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
473 0x0089: ('BracketingMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
474 {0x00: 'Single frame, no bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
475 0x01: 'Continuous, no bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
476 0x02: 'Timer, no bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
477 0x10: 'Single frame, exposure bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
478 0x11: 'Continuous, exposure bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
479 0x12: 'Timer, exposure bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
480 0x40: 'Single frame, white balance bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
481 0x41: 'Continuous, white balance bracketing',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
482 0x42: 'Timer, white balance bracketing'}),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
483 0x008A: ('AutoBracketRelease', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
484 0x008B: ('LensFStops', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
485 0x008C: ('NEFCurve2', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
486 0x008D: ('ColorMode', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
487 0x008F: ('SceneMode', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
488 0x0090: ('LightingType', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
489 0x0091: ('ShotInfo', ), # First 4 bytes are probably a version number in ASCII
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
490 0x0092: ('HueAdjustment', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
491 # 0x0093: ('SaturationAdjustment', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
492 0x0094: ('Saturation', # Name conflict with 0x00AA !!
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
493 {-3: 'B&W',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
494 -2: '-2',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
495 -1: '-1',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
496 0: '0',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
497 1: '1',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
498 2: '2'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
499 0x0095: ('NoiseReduction', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
500 0x0096: ('NEFCurve2', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
501 0x0097: ('ColorBalance', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
502 0x0098: ('LensData', ), # First 4 bytes are a version number in ASCII
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
503 0x0099: ('RawImageCenter', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
504 0x009A: ('SensorPixelSize', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
505 0x009C: ('Scene Assist', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
506 0x00A0: ('SerialNumber', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
507 0x00A2: ('ImageDataSize', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
508 # A4: In NEF, looks like a 4 byte ASCII version number
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
509 0x00A5: ('ImageCount', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
510 0x00A6: ('DeletedImageCount', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
511 0x00A7: ('TotalShutterReleases', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
512 # A8: ExposureMode? JPG: First 4 bytes are probably a version number in ASCII
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
513 # But in a sample NEF, its 8 zeros, then the string "NORMAL"
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
514 0x00A9: ('ImageOptimization', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
515 0x00AA: ('Saturation', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
516 0x00AB: ('DigitalVariProgram', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
517 0x00AC: ('ImageStabilization', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
518 0x00AD: ('Responsive AF', ), # 'AFResponse'
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
519 0x0010: ('DataDump', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
520 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
521
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
522 MAKERNOTE_NIKON_OLDER_TAGS = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
523 0x0003: ('Quality',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
524 {1: 'VGA Basic',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
525 2: 'VGA Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
526 3: 'VGA Fine',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
527 4: 'SXGA Basic',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
528 5: 'SXGA Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
529 6: 'SXGA Fine'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
530 0x0004: ('ColorMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
531 {1: 'Color',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
532 2: 'Monochrome'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
533 0x0005: ('ImageAdjustment',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
534 {0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
535 1: 'Bright+',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
536 2: 'Bright-',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
537 3: 'Contrast+',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
538 4: 'Contrast-'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
539 0x0006: ('CCDSpeed',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
540 {0: 'ISO 80',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
541 2: 'ISO 160',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
542 4: 'ISO 320',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
543 5: 'ISO 100'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
544 0x0007: ('WhiteBalance',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
545 {0: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
546 1: 'Preset',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
547 2: 'Daylight',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
548 3: 'Incandescent',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
549 4: 'Fluorescent',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
550 5: 'Cloudy',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
551 6: 'Speed Light'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
552 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
553
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
554 # decode Olympus SpecialMode tag in MakerNote
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
555 def olympus_special_mode(v):
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
556 a={
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
557 0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
558 1: 'Unknown',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
559 2: 'Fast',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
560 3: 'Panorama'}
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
561 b={
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
562 0: 'Non-panoramic',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
563 1: 'Left to right',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
564 2: 'Right to left',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
565 3: 'Bottom to top',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
566 4: 'Top to bottom'}
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
567 if v[0] not in a or v[2] not in b:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
568 return v
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
569 return '%s - sequence %d - %s' % (a[v[0]], v[1], b[v[2]])
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
570
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
571 MAKERNOTE_OLYMPUS_TAGS={
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
572 # ah HAH! those sneeeeeaky bastids! this is how they get past the fact
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
573 # that a JPEG thumbnail is not allowed in an uncompressed TIFF file
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
574 0x0100: ('JPEGThumbnail', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
575 0x0200: ('SpecialMode', olympus_special_mode),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
576 0x0201: ('JPEGQual',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
577 {1: 'SQ',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
578 2: 'HQ',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
579 3: 'SHQ'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
580 0x0202: ('Macro',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
581 {0: 'Normal',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
582 1: 'Macro',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
583 2: 'SuperMacro'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
584 0x0203: ('BWMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
585 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
586 1: 'On'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
587 0x0204: ('DigitalZoom', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
588 0x0205: ('FocalPlaneDiagonal', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
589 0x0206: ('LensDistortionParams', ),
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
590 0x0207: ('SoftwareRelease', ),
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
591 0x0208: ('PictureInfo', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
592 0x0209: ('CameraID', make_string), # print as string
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
593 0x0F00: ('DataDump', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
594 0x0300: ('PreCaptureFrames', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
595 0x0404: ('SerialNumber', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
596 0x1000: ('ShutterSpeedValue', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
597 0x1001: ('ISOValue', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
598 0x1002: ('ApertureValue', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
599 0x1003: ('BrightnessValue', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
600 0x1004: ('FlashMode', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
601 0x1004: ('FlashMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
602 {2: 'On',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
603 3: 'Off'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
604 0x1005: ('FlashDevice',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
605 {0: 'None',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
606 1: 'Internal',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
607 4: 'External',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
608 5: 'Internal + External'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
609 0x1006: ('ExposureCompensation', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
610 0x1007: ('SensorTemperature', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
611 0x1008: ('LensTemperature', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
612 0x100b: ('FocusMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
613 {0: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
614 1: 'Manual'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
615 0x1017: ('RedBalance', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
616 0x1018: ('BlueBalance', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
617 0x101a: ('SerialNumber', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
618 0x1023: ('FlashExposureComp', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
619 0x1026: ('ExternalFlashBounce',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
620 {0: 'No',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
621 1: 'Yes'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
622 0x1027: ('ExternalFlashZoom', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
623 0x1028: ('ExternalFlashMode', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
624 0x1029: ('Contrast int16u',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
625 {0: 'High',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
626 1: 'Normal',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
627 2: 'Low'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
628 0x102a: ('SharpnessFactor', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
629 0x102b: ('ColorControl', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
630 0x102c: ('ValidBits', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
631 0x102d: ('CoringFilter', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
632 0x102e: ('OlympusImageWidth', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
633 0x102f: ('OlympusImageHeight', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
634 0x1034: ('CompressionRatio', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
635 0x1035: ('PreviewImageValid',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
636 {0: 'No',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
637 1: 'Yes'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
638 0x1036: ('PreviewImageStart', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
639 0x1037: ('PreviewImageLength', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
640 0x1039: ('CCDScanMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
641 {0: 'Interlaced',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
642 1: 'Progressive'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
643 0x103a: ('NoiseReduction',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
644 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
645 1: 'On'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
646 0x103b: ('InfinityLensStep', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
647 0x103c: ('NearLensStep', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
648
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
649 # TODO - these need extra definitions
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
650 # http://search.cpan.org/src/EXIFTOOL/Image-ExifTool-6.90/html/TagNames/Olympus.html
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
651 0x2010: ('Equipment', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
652 0x2020: ('CameraSettings', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
653 0x2030: ('RawDevelopment', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
654 0x2040: ('ImageProcessing', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
655 0x2050: ('FocusInfo', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
656 0x3000: ('RawInfo ', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
657 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
658
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
659 # 0x2020 CameraSettings
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
660 MAKERNOTE_OLYMPUS_TAG_0x2020={
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
661 0x0100: ('PreviewImageValid',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
662 {0: 'No',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
663 1: 'Yes'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
664 0x0101: ('PreviewImageStart', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
665 0x0102: ('PreviewImageLength', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
666 0x0200: ('ExposureMode', {
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
667 1: 'Manual',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
668 2: 'Program',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
669 3: 'Aperture-priority AE',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
670 4: 'Shutter speed priority AE',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
671 5: 'Program-shift'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
672 0x0201: ('AELock',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
673 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
674 1: 'On'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
675 0x0202: ('MeteringMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
676 {2: 'Center Weighted',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
677 3: 'Spot',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
678 5: 'ESP',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
679 261: 'Pattern+AF',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
680 515: 'Spot+Highlight control',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
681 1027: 'Spot+Shadow control'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
682 0x0300: ('MacroMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
683 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
684 1: 'On'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
685 0x0301: ('FocusMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
686 {0: 'Single AF',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
687 1: 'Sequential shooting AF',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
688 2: 'Continuous AF',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
689 3: 'Multi AF',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
690 10: 'MF'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
691 0x0302: ('FocusProcess',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
692 {0: 'AF Not Used',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
693 1: 'AF Used'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
694 0x0303: ('AFSearch',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
695 {0: 'Not Ready',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
696 1: 'Ready'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
697 0x0304: ('AFAreas', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
698 0x0401: ('FlashExposureCompensation', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
699 0x0500: ('WhiteBalance2',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
700 {0: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
701 16: '7500K (Fine Weather with Shade)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
702 17: '6000K (Cloudy)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
703 18: '5300K (Fine Weather)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
704 20: '3000K (Tungsten light)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
705 21: '3600K (Tungsten light-like)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
706 33: '6600K (Daylight fluorescent)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
707 34: '4500K (Neutral white fluorescent)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
708 35: '4000K (Cool white fluorescent)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
709 48: '3600K (Tungsten light-like)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
710 256: 'Custom WB 1',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
711 257: 'Custom WB 2',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
712 258: 'Custom WB 3',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
713 259: 'Custom WB 4',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
714 512: 'Custom WB 5400K',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
715 513: 'Custom WB 2900K',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
716 514: 'Custom WB 8000K', }),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
717 0x0501: ('WhiteBalanceTemperature', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
718 0x0502: ('WhiteBalanceBracket', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
719 0x0503: ('CustomSaturation', ), # (3 numbers: 1. CS Value, 2. Min, 3. Max)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
720 0x0504: ('ModifiedSaturation',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
721 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
722 1: 'CM1 (Red Enhance)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
723 2: 'CM2 (Green Enhance)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
724 3: 'CM3 (Blue Enhance)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
725 4: 'CM4 (Skin Tones)'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
726 0x0505: ('ContrastSetting', ), # (3 numbers: 1. Contrast, 2. Min, 3. Max)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
727 0x0506: ('SharpnessSetting', ), # (3 numbers: 1. Sharpness, 2. Min, 3. Max)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
728 0x0507: ('ColorSpace',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
729 {0: 'sRGB',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
730 1: 'Adobe RGB',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
731 2: 'Pro Photo RGB'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
732 0x0509: ('SceneMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
733 {0: 'Standard',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
734 6: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
735 7: 'Sport',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
736 8: 'Portrait',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
737 9: 'Landscape+Portrait',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
738 10: 'Landscape',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
739 11: 'Night scene',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
740 13: 'Panorama',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
741 16: 'Landscape+Portrait',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
742 17: 'Night+Portrait',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
743 19: 'Fireworks',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
744 20: 'Sunset',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
745 22: 'Macro',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
746 25: 'Documents',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
747 26: 'Museum',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
748 28: 'Beach&Snow',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
749 30: 'Candle',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
750 35: 'Underwater Wide1',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
751 36: 'Underwater Macro',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
752 39: 'High Key',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
753 40: 'Digital Image Stabilization',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
754 44: 'Underwater Wide2',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
755 45: 'Low Key',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
756 46: 'Children',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
757 48: 'Nature Macro'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
758 0x050a: ('NoiseReduction',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
759 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
760 1: 'Noise Reduction',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
761 2: 'Noise Filter',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
762 3: 'Noise Reduction + Noise Filter',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
763 4: 'Noise Filter (ISO Boost)',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
764 5: 'Noise Reduction + Noise Filter (ISO Boost)'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
765 0x050b: ('DistortionCorrection',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
766 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
767 1: 'On'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
768 0x050c: ('ShadingCompensation',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
769 {0: 'Off',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
770 1: 'On'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
771 0x050d: ('CompressionFactor', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
772 0x050f: ('Gradation',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
773 {'-1 -1 1': 'Low Key',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
774 '0 -1 1': 'Normal',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
775 '1 -1 1': 'High Key'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
776 0x0520: ('PictureMode',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
777 {1: 'Vivid',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
778 2: 'Natural',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
779 3: 'Muted',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
780 256: 'Monotone',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
781 512: 'Sepia'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
782 0x0521: ('PictureModeSaturation', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
783 0x0522: ('PictureModeHue?', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
784 0x0523: ('PictureModeContrast', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
785 0x0524: ('PictureModeSharpness', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
786 0x0525: ('PictureModeBWFilter',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
787 {0: 'n/a',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
788 1: 'Neutral',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
789 2: 'Yellow',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
790 3: 'Orange',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
791 4: 'Red',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
792 5: 'Green'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
793 0x0526: ('PictureModeTone',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
794 {0: 'n/a',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
795 1: 'Neutral',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
796 2: 'Sepia',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
797 3: 'Blue',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
798 4: 'Purple',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
799 5: 'Green'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
800 0x0600: ('Sequence', ), # 2 or 3 numbers: 1. Mode, 2. Shot number, 3. Mode bits
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
801 0x0601: ('PanoramaMode', ), # (2 numbers: 1. Mode, 2. Shot number)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
802 0x0603: ('ImageQuality2',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
803 {1: 'SQ',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
804 2: 'HQ',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
805 3: 'SHQ',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
806 4: 'RAW'}),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
807 0x0901: ('ManometerReading', ),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
808 }
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
809
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
810
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
811 MAKERNOTE_CASIO_TAGS={
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
812 0x0001: ('RecordingMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
813 {1: 'Single Shutter',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
814 2: 'Panorama',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
815 3: 'Night Scene',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
816 4: 'Portrait',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
817 5: 'Landscape'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
818 0x0002: ('Quality',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
819 {1: 'Economy',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
820 2: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
821 3: 'Fine'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
822 0x0003: ('FocusingMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
823 {2: 'Macro',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
824 3: 'Auto Focus',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
825 4: 'Manual Focus',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
826 5: 'Infinity'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
827 0x0004: ('FlashMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
828 {1: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
829 2: 'On',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
830 3: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
831 4: 'Red Eye Reduction'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
832 0x0005: ('FlashIntensity',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
833 {11: 'Weak',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
834 13: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
835 15: 'Strong'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
836 0x0006: ('Object Distance', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
837 0x0007: ('WhiteBalance',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
838 {1: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
839 2: 'Tungsten',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
840 3: 'Daylight',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
841 4: 'Fluorescent',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
842 5: 'Shade',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
843 129: 'Manual'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
844 0x000B: ('Sharpness',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
845 {0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
846 1: 'Soft',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
847 2: 'Hard'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
848 0x000C: ('Contrast',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
849 {0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
850 1: 'Low',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
851 2: 'High'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
852 0x000D: ('Saturation',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
853 {0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
854 1: 'Low',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
855 2: 'High'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
856 0x0014: ('CCDSpeed',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
857 {64: 'Normal',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
858 80: 'Normal',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
859 100: 'High',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
860 125: '+1.0',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
861 244: '+3.0',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
862 250: '+2.0'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
863 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
864
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
865 MAKERNOTE_FUJIFILM_TAGS={
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
866 0x0000: ('NoteVersion', make_string),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
867 0x1000: ('Quality', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
868 0x1001: ('Sharpness',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
869 {1: 'Soft',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
870 2: 'Soft',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
871 3: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
872 4: 'Hard',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
873 5: 'Hard'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
874 0x1002: ('WhiteBalance',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
875 {0: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
876 256: 'Daylight',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
877 512: 'Cloudy',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
878 768: 'DaylightColor-Fluorescent',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
879 769: 'DaywhiteColor-Fluorescent',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
880 770: 'White-Fluorescent',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
881 1024: 'Incandescent',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
882 3840: 'Custom'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
883 0x1003: ('Color',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
884 {0: 'Normal',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
885 256: 'High',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
886 512: 'Low'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
887 0x1004: ('Tone',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
888 {0: 'Normal',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
889 256: 'High',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
890 512: 'Low'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
891 0x1010: ('FlashMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
892 {0: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
893 1: 'On',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
894 2: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
895 3: 'Red Eye Reduction'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
896 0x1011: ('FlashStrength', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
897 0x1020: ('Macro',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
898 {0: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
899 1: 'On'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
900 0x1021: ('FocusMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
901 {0: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
902 1: 'Manual'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
903 0x1030: ('SlowSync',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
904 {0: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
905 1: 'On'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
906 0x1031: ('PictureMode',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
907 {0: 'Auto',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
908 1: 'Portrait',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
909 2: 'Landscape',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
910 4: 'Sports',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
911 5: 'Night',
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
912 6: 'Program AE',
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
913 256: 'Aperture Priority AE',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
914 512: 'Shutter Priority AE',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
915 768: 'Manual Exposure'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
916 0x1100: ('MotorOrBracket',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
917 {0: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
918 1: 'On'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
919 0x1300: ('BlurWarning',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
920 {0: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
921 1: 'On'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
922 0x1301: ('FocusWarning',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
923 {0: 'Off',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
924 1: 'On'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
925 0x1302: ('AEWarning',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
926 {0: 'Off',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
927 1: 'On'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
928 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
929
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
930 MAKERNOTE_CANON_TAGS = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
931 0x0006: ('ImageType', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
932 0x0007: ('FirmwareVersion', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
933 0x0008: ('ImageNumber', ),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
934 0x0009: ('OwnerName', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
935 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
936
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
937 # this is in element offset, name, optional value dictionary format
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
938 MAKERNOTE_CANON_TAG_0x001 = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
939 1: ('Macromode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
940 {1: 'Macro',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
941 2: 'Normal'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
942 2: ('SelfTimer', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
943 3: ('Quality',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
944 {2: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
945 3: 'Fine',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
946 5: 'Superfine'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
947 4: ('FlashMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
948 {0: 'Flash Not Fired',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
949 1: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
950 2: 'On',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
951 3: 'Red-Eye Reduction',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
952 4: 'Slow Synchro',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
953 5: 'Auto + Red-Eye Reduction',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
954 6: 'On + Red-Eye Reduction',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
955 16: 'external flash'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
956 5: ('ContinuousDriveMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
957 {0: 'Single Or Timer',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
958 1: 'Continuous'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
959 7: ('FocusMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
960 {0: 'One-Shot',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
961 1: 'AI Servo',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
962 2: 'AI Focus',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
963 3: 'MF',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
964 4: 'Single',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
965 5: 'Continuous',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
966 6: 'MF'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
967 10: ('ImageSize',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
968 {0: 'Large',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
969 1: 'Medium',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
970 2: 'Small'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
971 11: ('EasyShootingMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
972 {0: 'Full Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
973 1: 'Manual',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
974 2: 'Landscape',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
975 3: 'Fast Shutter',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
976 4: 'Slow Shutter',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
977 5: 'Night',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
978 6: 'B&W',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
979 7: 'Sepia',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
980 8: 'Portrait',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
981 9: 'Sports',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
982 10: 'Macro/Close-Up',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
983 11: 'Pan Focus'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
984 12: ('DigitalZoom',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
985 {0: 'None',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
986 1: '2x',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
987 2: '4x'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
988 13: ('Contrast',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
989 {0xFFFF: 'Low',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
990 0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
991 1: 'High'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
992 14: ('Saturation',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
993 {0xFFFF: 'Low',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
994 0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
995 1: 'High'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
996 15: ('Sharpness',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
997 {0xFFFF: 'Low',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
998 0: 'Normal',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
999 1: 'High'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1000 16: ('ISO',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1001 {0: 'See ISOSpeedRatings Tag',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1002 15: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1003 16: '50',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1004 17: '100',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1005 18: '200',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1006 19: '400'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1007 17: ('MeteringMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1008 {3: 'Evaluative',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1009 4: 'Partial',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1010 5: 'Center-weighted'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1011 18: ('FocusType',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1012 {0: 'Manual',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1013 1: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1014 3: 'Close-Up (Macro)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1015 8: 'Locked (Pan Mode)'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1016 19: ('AFPointSelected',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1017 {0x3000: 'None (MF)',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1018 0x3001: 'Auto-Selected',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1019 0x3002: 'Right',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1020 0x3003: 'Center',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1021 0x3004: 'Left'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1022 20: ('ExposureMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1023 {0: 'Easy Shooting',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1024 1: 'Program',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1025 2: 'Tv-priority',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1026 3: 'Av-priority',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1027 4: 'Manual',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1028 5: 'A-DEP'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1029 23: ('LongFocalLengthOfLensInFocalUnits', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1030 24: ('ShortFocalLengthOfLensInFocalUnits', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1031 25: ('FocalUnitsPerMM', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1032 28: ('FlashActivity',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1033 {0: 'Did Not Fire',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1034 1: 'Fired'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1035 29: ('FlashDetails',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1036 {14: 'External E-TTL',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1037 13: 'Internal Flash',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1038 11: 'FP Sync Used',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1039 7: '2nd("Rear")-Curtain Sync Used',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1040 4: 'FP Sync Enabled'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1041 32: ('FocusMode',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1042 {0: 'Single',
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1043 1: 'Continuous'}),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1044 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1045
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1046 MAKERNOTE_CANON_TAG_0x004 = {
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1047 7: ('WhiteBalance',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1048 {0: 'Auto',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1049 1: 'Sunny',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1050 2: 'Cloudy',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1051 3: 'Tungsten',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1052 4: 'Fluorescent',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1053 5: 'Flash',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1054 6: 'Custom'}),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1055 9: ('SequenceNumber', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1056 14: ('AFPointUsed', ),
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1057 15: ('FlashBias',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1058 {0XFFC0: '-2 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1059 0XFFCC: '-1.67 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1060 0XFFD0: '-1.50 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1061 0XFFD4: '-1.33 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1062 0XFFE0: '-1 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1063 0XFFEC: '-0.67 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1064 0XFFF0: '-0.50 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1065 0XFFF4: '-0.33 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1066 0X0000: '0 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1067 0X000C: '0.33 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1068 0X0010: '0.50 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1069 0X0014: '0.67 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1070 0X0020: '1 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1071 0X002C: '1.33 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1072 0X0030: '1.50 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1073 0X0034: '1.67 EV',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1074 0X0040: '2 EV'}),
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1075 19: ('SubjectDistance', ),
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1076 }
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1077
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1078 # extract multibyte integer in Motorola format (little endian)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1079 def s2n_motorola(str):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1080 x = 0
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1081 for c in str:
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1082 x = (x << 8) | ord(c)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1083 return x
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1084
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1085 # extract multibyte integer in Intel format (big endian)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1086 def s2n_intel(str):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1087 x = 0
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1088 y = 0L
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1089 for c in str:
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1090 x = x | (ord(c) << y)
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1091 y = y + 8
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1092 return x
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1093
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1094 # ratio object that eventually will be able to reduce itself to lowest
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1095 # common denominator for printing
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1096 def gcd(a, b):
1920
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
1097 if b == 0:
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
1098 return a
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
1099 else:
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
1100 return gcd(b, a % b)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1101
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1102 class Ratio:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1103 def __init__(self, num, den):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1104 self.num = num
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1105 self.den = den
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1106
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1107 def __repr__(self):
4729
2a55ba43afb3 filter.EXIF: reduce renamed to reduce_size (avoid name clash)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2900
diff changeset
1108 self.reduce_size()
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1109 if self.den == 1:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1110 return str(self.num)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1111 return '%d/%d' % (self.num, self.den)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1112
4729
2a55ba43afb3 filter.EXIF: reduce renamed to reduce_size (avoid name clash)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2900
diff changeset
1113 def reduce_size(self):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1114 div = gcd(self.num, self.den)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1115 if div > 1:
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1116 self.num = self.num / div
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1117 self.den = self.den / div
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1118
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1119 # for ease of dealing with tags
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1120 class IFD_Tag:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1121 def __init__(self, printable, tag, field_type, values, field_offset,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1122 field_length):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1123 # printable version of data
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1124 self.printable = printable
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1125 # tag ID number
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1126 self.tag = tag
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1127 # field type as index into FIELD_TYPES
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1128 self.field_type = field_type
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1129 # offset of start of field in bytes from beginning of IFD
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1130 self.field_offset = field_offset
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1131 # length of data field in bytes
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1132 self.field_length = field_length
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1133 # either a string or array of data items
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1134 self.values = values
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1135
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1136 def __str__(self):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1137 return self.printable
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1138
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1139 def __repr__(self):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1140 return '(0x%04X) %s=%s @ %d' % (self.tag,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1141 FIELD_TYPES[self.field_type][2],
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1142 self.printable,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1143 self.field_offset)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1144
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1145 # class that handles an EXIF header
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1146 class EXIF_header:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1147 def __init__(self, file, endian, offset, fake_exif, debug=0):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1148 self.file = file
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1149 self.endian = endian
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1150 self.offset = offset
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1151 self.fake_exif = fake_exif
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1152 self.debug = debug
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1153 self.tags = {}
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1154
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1155 # convert slice to integer, based on sign and endian flags
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1156 # usually this offset is assumed to be relative to the beginning of the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1157 # start of the EXIF information. For some cameras that use relative tags,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1158 # this offset may be relative to some other starting point.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1159 def s2n(self, offset, length, signed=0):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1160 self.file.seek(self.offset+offset)
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1161 slice=self.file.read(length)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1162 if self.endian == 'I':
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1163 val=s2n_intel(slice)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1164 else:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1165 val=s2n_motorola(slice)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1166 # Sign extension ?
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1167 if signed:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1168 msb=1L << (8*length-1)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1169 if val & msb:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1170 val=val-(msb << 1)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1171 return val
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1172
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1173 # convert offset to string
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1174 def n2s(self, offset, length):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1175 s = ''
1793
2a4caa295346 Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1792
diff changeset
1176 for dummy in range(length):
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1177 if self.endian == 'I':
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1178 s = s + chr(offset & 0xFF)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1179 else:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1180 s = chr(offset & 0xFF) + s
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1181 offset = offset >> 8
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1182 return s
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1183
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1184 # return first IFD
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1185 def first_IFD(self):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1186 return self.s2n(4, 4)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1187
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1188 # return pointer to next IFD
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1189 def next_IFD(self, ifd):
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1190 entries=self.s2n(ifd, 2)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1191 return self.s2n(ifd+2+12*entries, 4)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1192
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1193 # return list of IFDs in header
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1194 def list_IFDs(self):
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1195 i=self.first_IFD()
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1196 a=[]
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1197 while i:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1198 a.append(i)
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1199 i=self.next_IFD(i)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1200 return a
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1201
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1202 # return list of entries in this IFD
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1203 def dump_IFD(self, ifd, ifd_name, dict=EXIF_TAGS, relative=0, name='UNDEF'):
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1204 entries=self.s2n(ifd, 2)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1205 for i in range(entries):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1206 # entry is index of start of this IFD in the file
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1207 entry = ifd + 2 + 12 * i
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1208 tag = self.s2n(entry, 2)
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1209
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1210 # ignore certain tags for faster processing
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1211 if not (tag in IGNORE_TAGS and not detailed):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1212 # get tag name. We do it early to make debugging easier
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1213 tag_entry = dict.get(tag)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1214 if tag_entry:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1215 tag_name = tag_entry[0]
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1216 else:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1217 tag_name = 'Tag 0x%04X' % tag
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1218
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1219 field_type = self.s2n(entry + 2, 2)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1220 if not 0 < field_type < len(FIELD_TYPES):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1221 # unknown field type
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1222 raise ValueError('unknown type %d in tag 0x%04X' % (field_type, tag))
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1223 typelen = FIELD_TYPES[field_type][0]
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1224 count = self.s2n(entry + 4, 4)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1225 offset = entry + 8
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1226 if count * typelen > 4:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1227 # offset is not the value; it's a pointer to the value
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1228 # if relative we set things up so s2n will seek to the right
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1229 # place when it adds self.offset. Note that this 'relative'
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1230 # is for the Nikon type 3 makernote. Other cameras may use
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1231 # other relative offsets, which would have to be computed here
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1232 # slightly differently.
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1233 if relative:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1234 tmp_offset = self.s2n(offset, 4)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1235 offset = tmp_offset + ifd - self.offset + 4
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1236 if self.fake_exif:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1237 offset = offset + 18
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1238 else:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1239 offset = self.s2n(offset, 4)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1240 field_offset = offset
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1241 if field_type == 2:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1242 # special case: null-terminated ASCII string
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1243 if count != 0:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1244 self.file.seek(self.offset + offset)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1245 values = self.file.read(count)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1246 values = values.strip().replace('\x00', '')
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1247 else:
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1248 values = ''
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1249 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1250 values = []
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1251 signed = (field_type in [6, 8, 9, 10])
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1252 for dummy in range(count):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1253 if field_type in (5, 10):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1254 # a ratio
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1255 value = Ratio(self.s2n(offset, 4, signed),
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1256 self.s2n(offset + 4, 4, signed))
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1257 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1258 value = self.s2n(offset, typelen, signed)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1259 values.append(value)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1260 offset = offset + typelen
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1261 # now "values" is either a string or an array
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1262 if count == 1 and field_type != 2:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1263 printable=str(values[0])
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1264 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1265 printable=str(values)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1266 # compute printable version of values
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1267 if tag_entry:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1268 if len(tag_entry) != 1:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1269 # optional 2nd tag element is present
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1270 if callable(tag_entry[1]):
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1271 # call mapping function
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1272 printable = tag_entry[1](values)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1273 else:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1274 printable = ''
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1275 for i in values:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1276 # use lookup table for this tag
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1277 printable += tag_entry[1].get(i, repr(i))
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1278
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1279 self.tags[ifd_name + ' ' + tag_name] = IFD_Tag(printable, tag,
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1280 field_type,
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1281 values, field_offset,
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1282 count * typelen)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1283 if self.debug:
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1284 print ' debug: %s: %s' % (tag_name,
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1285 repr(self.tags[ifd_name + ' ' + tag_name]))
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1286
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1287 if tag_name == name:
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1288 break
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1289
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1290 # extract uncompressed TIFF thumbnail (like pulling teeth)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1291 # we take advantage of the pre-existing layout in the thumbnail IFD as
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1292 # much as possible
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1293 def extract_TIFF_thumbnail(self, thumb_ifd):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1294 entries = self.s2n(thumb_ifd, 2)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1295 # this is header plus offset to IFD ...
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1296 if self.endian == 'M':
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1297 tiff = 'MM\x00*\x00\x00\x00\x08'
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1298 else:
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1299 tiff = 'II*\x00\x08\x00\x00\x00'
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1300 # ... plus thumbnail IFD data plus a null "next IFD" pointer
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1301 self.file.seek(self.offset+thumb_ifd)
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1302 tiff += self.file.read(entries*12+2)+'\x00\x00\x00\x00'
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1303
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1304 # fix up large value offset pointers into data area
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1305 for i in range(entries):
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1306 entry = thumb_ifd + 2 + 12 * i
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1307 tag = self.s2n(entry, 2)
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1308 field_type = self.s2n(entry+2, 2)
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1309 typelen = FIELD_TYPES[field_type][0]
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1310 count = self.s2n(entry+4, 4)
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1311 oldoff = self.s2n(entry+8, 4)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1312 # start of the 4-byte pointer area in entry
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1313 ptr = i * 12 + 18
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1314 # remember strip offsets location
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1315 if tag == 0x0111:
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1316 strip_off = ptr
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1317 strip_len = count * typelen
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1318 # is it in the data area?
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1319 if count * typelen > 4:
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1320 # update offset pointer (nasty "strings are immutable" crap)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1321 # should be able to say "tiff[ptr:ptr+4]=newoff"
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1322 newoff = len(tiff)
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
1323 tiff = tiff[:ptr] + self.n2s(newoff, 4) + tiff[ptr+4:]
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1324 # remember strip offsets location
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1325 if tag == 0x0111:
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1326 strip_off = newoff
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1327 strip_len = 4
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1328 # get original data and store it
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1329 self.file.seek(self.offset + oldoff)
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1330 tiff += self.file.read(count * typelen)
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1331
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1332 # add pixel strips and update strip offset info
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1333 old_offsets = self.tags['Thumbnail StripOffsets'].values
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1334 old_counts = self.tags['Thumbnail StripByteCounts'].values
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1335 for i in range(len(old_offsets)):
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1336 # update offset pointer (more nasty "strings are immutable" crap)
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1337 offset = self.n2s(len(tiff), strip_len)
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1338 tiff = tiff[:strip_off] + offset + tiff[strip_off + strip_len:]
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1339 strip_off += strip_len
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1340 # add pixel strip to end
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1341 self.file.seek(self.offset + old_offsets[i])
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1342 tiff += self.file.read(old_counts[i])
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1343
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1344 self.tags['TIFFThumbnail'] = tiff
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1345
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1346 # decode all the camera-specific MakerNote formats
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1347
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1348 # Note is the data that comprises this MakerNote. The MakerNote will
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1349 # likely have pointers in it that point to other parts of the file. We'll
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1350 # use self.offset as the starting point for most of those pointers, since
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1351 # they are relative to the beginning of the file.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1352 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1353 # If the MakerNote is in a newer format, it may use relative addressing
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1354 # within the MakerNote. In that case we'll use relative addresses for the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1355 # pointers.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1356 #
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1357 # As an aside: it's not just to be annoying that the manufacturers use
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1358 # relative offsets. It's so that if the makernote has to be moved by the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1359 # picture software all of the offsets don't have to be adjusted. Overall,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1360 # this is probably the right strategy for makernotes, though the spec is
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1361 # ambiguous. (The spec does not appear to imagine that makernotes would
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1362 # follow EXIF format internally. Once they did, it's ambiguous whether
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1363 # the offsets should be from the header at the start of all the EXIF info,
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1364 # or from the header at the start of the makernote.)
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1365 def decode_maker_note(self):
1703
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1366 note = self.tags['EXIF MakerNote']
0803e5da055d EXIF.py: optional parameter 'name' for process_file and dump_IFD. If used the reading of EXIF data ends after that name. some PEP8 changes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1184
diff changeset
1367 make = self.tags['Image Make'].printable
2900
7028ac728357 copied updated EXIF.py from 1.6 branch
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2791
diff changeset
1368 # model = self.tags['Image Model'].printable # unused
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1369
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1370 # Nikon
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1371 # The maker note usually starts with the word Nikon, followed by the
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1372 # type of the makernote (1 or 2, as a short). If the word Nikon is
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1373 # not at the start of the makernote, it's probably type 2, since some
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1374 # cameras work that way.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1375 if make in ('NIKON', 'NIKON CORPORATION'):
2791
927ee24989f3 cosmetic fix: this is NOT octal
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2450
diff changeset
1376 if note.values[0:7] == [78, 105, 107, 111, 110, 0, 1]:
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1377 if self.debug:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1378 print "Looks like a type 1 Nikon MakerNote."
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1379 self.dump_IFD(note.field_offset+8, 'MakerNote',
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1380 dict=MAKERNOTE_NIKON_OLDER_TAGS)
2791
927ee24989f3 cosmetic fix: this is NOT octal
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2450
diff changeset
1381 elif note.values[0:7] == [78, 105, 107, 111, 110, 0, 2]:
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1382 if self.debug:
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1383 print "Looks like a labeled type 2 Nikon MakerNote"
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldma&#