diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-26 10:21:45 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-26 10:26:06 +0100 |
commit | ab7281fe240c34804d8a7d1be88619192d21aea8 (patch) | |
tree | da29e85f27076db4fd0e9a421e2b38193615c665 /extlib | |
parent | 71717fd5316607500159f782b10ca91cf9684bfd (diff) | |
download | mediagoblin-ab7281fe240c34804d8a7d1be88619192d21aea8.tar.lz mediagoblin-ab7281fe240c34804d8a7d1be88619192d21aea8.tar.xz mediagoblin-ab7281fe240c34804d8a7d1be88619192d21aea8.zip |
Fix up symlinks in exif bump
Previous exif bump copied the newer version into
mediagoblin/tools/extlib/exif but not in extlib/exif. Fix this by
bumping extlib/exif and symlinking to tools/extlib/exif.
Do note that this is still the version fetched from http://sourceforge.net/projects/exif-py/
while the upstream maintainer seems to be active on:
https://github.com/ianare/exif-py
(The sf.net download is quite new though)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'extlib')
-rwxr-xr-x | extlib/exif/EXIF.py | 85 | ||||
-rw-r--r-- | extlib/exif/changes.txt | 126 |
2 files changed, 180 insertions, 31 deletions
diff --git a/extlib/exif/EXIF.py b/extlib/exif/EXIF.py index ed4192af..b777db8f 100755 --- a/extlib/exif/EXIF.py +++ b/extlib/exif/EXIF.py @@ -4,7 +4,7 @@ # Library to extract EXIF information from digital camera image files # http://sourceforge.net/projects/exif-py/ # -# VERSION 1.1.0 +# VERSION 1.0.10 # # To use this library call with: # f = open(path_name, 'rb') @@ -171,9 +171,9 @@ EXIF_TAGS = { 3: 'Rotated 180', 4: 'Mirrored vertical', 5: 'Mirrored horizontal then rotated 90 CCW', - 6: 'Rotated 90 CW', + 6: 'Rotated 90 CCW', 7: 'Mirrored horizontal then rotated 90 CW', - 8: 'Rotated 90 CCW'}), + 8: 'Rotated 90 CW'}), 0x0115: ('SamplesPerPixel', ), 0x0116: ('RowsPerStrip', ), 0x0117: ('StripByteCounts', ), @@ -251,40 +251,54 @@ EXIF_TAGS = { 2: 'CenterWeightedAverage', 3: 'Spot', 4: 'MultiSpot', - 5: 'Pattern'}), + 5: 'Pattern', + 6: 'Partial', + 255: 'other'}), 0x9208: ('LightSource', {0: 'Unknown', 1: 'Daylight', 2: 'Fluorescent', - 3: 'Tungsten', - 9: 'Fine Weather', - 10: 'Flash', + 3: 'Tungsten (incandescent light)', + 4: 'Flash', + 9: 'Fine weather', + 10: 'Cloudy weather', 11: 'Shade', - 12: 'Daylight Fluorescent', - 13: 'Day White Fluorescent', - 14: 'Cool White Fluorescent', - 15: 'White Fluorescent', - 17: 'Standard Light A', - 18: 'Standard Light B', - 19: 'Standard Light C', + 12: 'Daylight fluorescent (D 5700 - 7100K)', + 13: 'Day white fluorescent (N 4600 - 5400K)', + 14: 'Cool white fluorescent (W 3900 - 4500K)', + 15: 'White fluorescent (WW 3200 - 3700K)', + 17: 'Standard light A', + 18: 'Standard light B', + 19: 'Standard light C', 20: 'D55', 21: 'D65', 22: 'D75', - 255: 'Other'}), + 23: 'D50', + 24: 'ISO studio tungsten', + 255: 'other light source',}), 0x9209: ('Flash', - {0: 'No', - 1: 'Fired', - 5: 'Fired (?)', # no return sensed - 7: 'Fired (!)', # return sensed - 9: 'Fill Fired', - 13: 'Fill Fired (?)', - 15: 'Fill Fired (!)', - 16: 'Off', - 24: 'Auto Off', - 25: 'Auto Fired', - 29: 'Auto Fired (?)', - 31: 'Auto Fired (!)', - 32: 'Not Available'}), + {0: 'Flash did not fire', + 1: 'Flash fired', + 5: 'Strobe return light not detected', + 7: 'Strobe return light detected', + 9: 'Flash fired, compulsory flash mode', + 13: 'Flash fired, compulsory flash mode, return light not detected', + 15: 'Flash fired, compulsory flash mode, return light detected', + 16: 'Flash did not fire, compulsory flash mode', + 24: 'Flash did not fire, auto mode', + 25: 'Flash fired, auto mode', + 29: 'Flash fired, auto mode, return light not detected', + 31: 'Flash fired, auto mode, return light detected', + 32: 'No flash function', + 65: 'Flash fired, red-eye reduction mode', + 69: 'Flash fired, red-eye reduction mode, return light not detected', + 71: 'Flash fired, red-eye reduction mode, return light detected', + 73: 'Flash fired, compulsory flash mode, red-eye reduction mode', + 77: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected', + 79: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected', + 89: 'Flash fired, auto mode, red-eye reduction mode', + 93: 'Flash fired, auto mode, return light not detected, red-eye reduction mode', + 95: 'Flash fired, auto mode, return light detected, red-eye reduction mode'}), 0x920A: ('FocalLength', ), 0x9214: ('SubjectArea', ), 0x927C: ('MakerNote', ), @@ -410,7 +424,10 @@ GPS_TAGS = { 0x0018: ('GPSDestBearing', ), 0x0019: ('GPSDestDistanceRef', ), 0x001A: ('GPSDestDistance', ), + 0x001B: ('GPSProcessingMethod', ), + 0x001C: ('GPSAreaInformation', ), 0x001D: ('GPSDate', ), + 0x001E: ('GPSDifferential', ), } # Ignore these tags when quick processing @@ -1283,7 +1300,11 @@ class EXIF_header: # return pointer to next IFD def next_IFD(self, ifd): entries=self.s2n(ifd, 2) - return self.s2n(ifd+2+12*entries, 4) + next_ifd = self.s2n(ifd+2+12*entries, 4) + if next_ifd == ifd: + return 0 + else: + return next_ifd # return list of IFDs in header def list_IFDs(self): @@ -1567,7 +1588,8 @@ class EXIF_header: dict=MAKERNOTE_CANON_TAGS) for i in (('MakerNote Tag 0x0001', MAKERNOTE_CANON_TAG_0x001), ('MakerNote Tag 0x0004', MAKERNOTE_CANON_TAG_0x004)): - self.canon_decode_tag(self.tags[i[0]].values, i[1]) + if i[0] in self.tags: + self.canon_decode_tag(self.tags[i[0]].values, i[1]) return @@ -1632,7 +1654,8 @@ def process_file(f, stop_tag='UNDEF', details=True, strict=False, debug=False): # deal with the EXIF info we found if debug: - print {'I': 'Intel', 'M': 'Motorola'}[endian], 'format' + print "Endian format is ",endian + print {'I': 'Intel', 'M': 'Motorola', '\x01':'Adobe Ducky', 'd':'XMP/Adobe unknown' }[endian], 'format' hdr = EXIF_header(f, endian, offset, fake_exif, strict, debug) ifd_list = hdr.list_IFDs() ctr = 0 diff --git a/extlib/exif/changes.txt b/extlib/exif/changes.txt new file mode 100644 index 00000000..887d84fd --- /dev/null +++ b/extlib/exif/changes.txt @@ -0,0 +1,126 @@ +~ EXIF.py Changelog ~ + +2012-09-26 - Ianaré Sévi +Merge patches: + Add GPS tags + Add better endian debug info + +2012-06-13 - Ianaré Sévi +Merge patches: + Support malformed last IFD by fhats + Light source, Flash and Metering mode dictionaries update by gryfik + +2008-07-31 - Ianaré Sévi +Wikipedia Commons hunt for suitable test case images, +testing new code additions. + +2008-07-09 - Stephen H. Olson +Fix a problem with reading MakerNotes out of NEF files. +Add some more Nikon MakerNote tags. + +2008-07-08 - Stephen H. Olson +An error check for large tags totally borked MakerNotes. + With Nikon anyway, valid MakerNotes can be pretty big. +Add error check for a crash caused by nikon_ev_bias being + called with the wrong args. +Drop any garbage after a null character in string + (patch from Andrew McNabb <amcnabb@google.com>). + +2008-02-12 - Ianaré Sévi +Fix crash on invalid MakerNote +Fix crash on huge Makernote (temp fix) +Add printIM tag 0xC4A5, needs decoding info +Add 0x9C9B-F range of tags +Add a bunch of tag definitions from: + http://owl.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html +Add 'strict' variable and command line option + +2008-01-18 - Gunter Ohrner +Add 'GPSDate' tag + +2007-12-12 - Ianaré Sévi +Fix quick option on certain image types +Add note on tag naming in documentation + +2007-11-30 - Ianaré Sévi +Changed -s option to -t +Put changelog into separate file + +2007-10-28 - Ianaré Sévi +Merged changes from MoinMoin:ReimarBauer +Added command line option for debug, stop +processing on tag. + +2007-09-27 - Ianaré Sévi +Add some Olympus Makernote tags. + +2007-09-26 - Stephen H. Olson +Don't error out on invalid Olympus 'SpecialMode'. +Add a few more Olympus/Minolta tags. + +2007-09-22 - Stephen H. Olson +Don't error on invalid string +Improved Nikon MakerNote support + +2007-05-03 - Martin Stone <mj_stone@users.sourceforge.net> +Fix for inverted detailed flag and Photoshop header + +2007-03-24 - Ianaré Sévi +Can now ignore MakerNotes Tags for faster processing. + +2007-01-18 - Ianaré Sévi <ianare@gmail.com> +Fixed a couple errors and assuming maintenance of the library. + +2006-08-04 MoinMoin:ReimarBauer +Added an optional parameter name to process_file and dump_IFD. Using this parameter the +loop is breaked after that tag_name is processed. +some PEP8 changes + +---------------------------- original notices ------------------------- + +Contains code from "exifdump.py" originally written by Thierry Bousch +<bousch@topo.math.u-psud.fr> and released into the public domain. + +Updated and turned into general-purpose library by Gene Cash + +Patch Contributors: +* Simon J. Gerraty <sjg@crufty.net> +s2n fix & orientation decode +* John T. Riedl <riedl@cs.umn.edu> +Added support for newer Nikon type 3 Makernote format for D70 and some +other Nikon cameras. +* Joerg Schaefer <schaeferj@gmx.net> +Fixed subtle bug when faking an EXIF header, which affected maker notes +using relative offsets, and a fix for Nikon D100. + +1999-08-21 TB Last update by Thierry Bousch to his code. + +2002-01-17 CEC Discovered code on web. + Commented everything. + Made small code improvements. + Reformatted for readability. + +2002-01-19 CEC Added ability to read TIFFs and JFIF-format JPEGs. + Added ability to extract JPEG formatted thumbnail. + Added ability to read GPS IFD (not tested). + Converted IFD data structure to dictionaries indexed by + tag name. + Factored into library returning dictionary of IFDs plus + thumbnail, if any. + +2002-01-20 CEC Added MakerNote processing logic. + Added Olympus MakerNote. + Converted data structure to single-level dictionary, avoiding + tag name collisions by prefixing with IFD name. This makes + it much easier to use. +2002-01-23 CEC Trimmed nulls from end of string values. + +2002-01-25 CEC Discovered JPEG thumbnail in Olympus TIFF MakerNote. + +2002-01-26 CEC Added ability to extract TIFF thumbnails. + Added Nikon, Fujifilm, Casio MakerNotes. + +2003-11-30 CEC Fixed problem with canon_decode_tag() not creating an + IFD_Tag() object. + +2004-02-15 CEC Finally fixed bit shift warning by converting Y to 0L. |