--- EXIF.py 2006-09-05 00:16:48.000000000 -0400 +++ EXIFj.py 2006-09-05 00:18:15.000000000 -0400 @@ -253,6 +253,20 @@ 0xA301: ('SceneType', {1: 'Directly Photographed'}), 0xA302: ('CVAPattern',), + # added by jmoiron + 0xA401: ('CustomImageProcessing',), + 0xA402: ('ExposureMode',), + 0xA403: ('WhiteBalance',), + 0xA404: ('DigitalZoomRatio',), + 0xA405: ('FocalLengthIn35mmFilm',), + 0xA406: ('SceneCaptureType',), + 0xA407: ('GainControl',), + 0xA408: ('Contrast',), + 0xA409: ('Saturation',), + 0xA40A: ('Sharpness',), + 0xA40B: ('DeviceSettingsDescription',), + 0xA40C: ('SubjectDistanceRange',), + 0xC4A5: ('PrintIMData', lambda x: ''.join(map(chr,x))), } # interoperability tags @@ -423,6 +437,76 @@ 0x0F00: ('DataDump', ) } +MAKERNOTE_CASIO_TAGS_2={ + 0x0002: ('PreviewThumbnailDimensions', ), + 0x0003: ('PreviewThumbnailSize', ), + 0x0004: ('PreviewThumbnailOffset', ), + 0x0008: ('QualityMode', + {1: 'Fine', + 2: 'Super Fine',}), + 0x0009: ('ImageSize', + {0: '640x480', + 4: '1600x1200', + 5: '2048x1536', + 20: '2288x1712', + 21: '2592x1944', + 22: '2304x1728', + 36: '3008x2008',}), + 0x000D: ('FocusMode', + {0: 'Normal', + 1: 'Macro',}), + 0x0014: ('ISOSensitivity', + {3: '50', + 4: '64', + 6: '100', + 9: '200',}), + 0x0019: ('WhiteBalance', + {0: 'Auto', + 1: 'Daylight', + 2: 'Shade', + 3: 'Tungsten', + 4: 'Fluorescent', + 5: 'Manual',}), + 0x001D: ('FocalLength', ), + 0x001F: ('Saturation', + {0: '-1', + 1: 'Normal', + 2: '+1',}), + 0x0020: ('Contrast', + {0: '-1', + 1: 'Normal', + 2: '+1',}), + 0x0021: ('Sharpness', + {0: '-1', + 1: 'Normal', + 2: '+1',}), + 0x0E00: ('PrintIMInfo', ), + 0x2000: ('CasioPreviewThumbnail', ), + 0x2011: ('WhiteBalanceBias', ), + 0x2012: ('WhiteBalance', + {0: 'Manual', + 1: 'Auto?', + 4: 'Flash?', + 12: 'Flash',}), + 0x2022: ('ObjectDistance', ), + 0x2034: ('FlashDistance', ), + 0x3000: ('RecordMode', {2: 'Normal Mode'}), + 0x3001: ('SelfTimer?', {1: 'Off?'}), + 0x3002: ('Quality', {3: 'Fine'}), + 0x3003: ('FocusMode', + {1: 'Fixation', + 6: 'Multi-Area Auto Focus',}), + 0x3006: ('TimeZone', ), + 0x3007: ('BestshotMode', + {0: 'Off', + 1: 'On?',}), + 0x3014: ('ISOSensitivity', ), + 0x3015: ('ColourMode', {0: 'Off',}), + 0x3016: ('Enhancement', {0: 'Off',}), + 0x3017: ('Filter', {0: 'Off',}), + } + + MAKERNOTE_CASIO_TAGS={ 0x0001: ('RecordingMode', {1: 'Single Shutter', @@ -739,11 +823,17 @@ # printable version of data self.printable=printable # tag ID number - self.tag=tag + if type(tag) == type(None): + #print "Error? : " + str(tag) + ", " + str(type(tag)) + tag = 0x0006 + self.tag=int(tag) # field type as index into FIELD_TYPES self.field_type=field_type # offset of start of field in bytes from beginning of IFD - self.field_offset=field_offset + if type(field_offset) == type(None): + #print "Error? : " + str(field_offset) + ", " + str(type(field_offset)) + field_offset = 0x0006 + self.field_offset=int(field_offset) # length of data field in bytes self.field_length=field_length # either a string or array of data items @@ -975,7 +1065,6 @@ note=self.tags['EXIF MakerNote'] make=self.tags['Image Make'].printable model=self.tags['Image Model'].printable - # Nikon # The maker note usually starts with the word Nikon, followed by the # type of the makernote (1 or 2, as a short). If the word Nikon is @@ -1010,11 +1099,17 @@ return # Casio - if make == 'Casio': + if make[:5] in ('Casio', 'CASIO'): + # Casio type 2 (QVC\0x00\0x00\0x00) + if note.values[0:6] == [81, 86, 67, 0, 0, 0]: + self.dump_IFD(note.field_offset+6, 'MakerNote', + dict=MAKERNOTE_CASIO_TAGS_2) + return self.dump_IFD(note.field_offset, 'MakerNote', dict=MAKERNOTE_CASIO_TAGS) return - + + # Fujifilm if make == 'FUJIFILM': # bug: everything else is "Motorola" endian, but the MakerNote