aboutsummaryrefslogtreecommitdiffstats
path: root/scanner/PhotoAlbum.py
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-06-27 17:12:59 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-06-27 17:12:59 -0400
commit725cb85cdb0137e3db7d46edadd130b6a5980e5a (patch)
treee04852c06c4eb330da7988ec7a5735b6065a4be5 /scanner/PhotoAlbum.py
parentPut subalbums on top if more than one. (diff)
downloadPhotoFloat-725cb85cdb0137e3db7d46edadd130b6a5980e5a.tar.xz
PhotoFloat-725cb85cdb0137e3db7d46edadd130b6a5980e5a.zip
Add more exif types, thanks to the imageinfo javascript plugin in some random google chrome demo extension.
Diffstat (limited to '')
-rw-r--r--scanner/PhotoAlbum.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/scanner/PhotoAlbum.py b/scanner/PhotoAlbum.py
index 35b2ca1..78bdb63 100644
--- a/scanner/PhotoAlbum.py
+++ b/scanner/PhotoAlbum.py
@@ -187,12 +187,25 @@ class Photo(object):
raise
except:
pass
+ if "LightSource" in exif and exif["LightSource"] in self._metadata.light_source_dictionary:
+ try:
+ self._attributes["lightSource"] = self._metadata.light_source_dictionary[exif["LightSource"]]
+ except KeyboardInterrupt:
+ raise
+ except:
+ pass
if "ExposureProgram" in exif and exif["ExposureProgram"] < len(self._metadata.exposure_list):
self._attributes["exposureProgram"] = self._metadata.exposure_list[exif["ExposureProgram"]]
if "SpectralSensitivity" in exif:
self._attributes["spectralSensitivity"] = exif["SpectralSensitivity"]
if "MeteringMode" in exif and exif["MeteringMode"] < len(self._metadata.metering_list):
self._attributes["meteringMode"] = self._metadata.metering_list[exif["MeteringMode"]]
+ if "SensingMethod" in exif and exif["SensingMethod"] < len(self._metadata.sensing_method_list):
+ self._attributes["sensingMethod"] = self._metadata.sensing_method_list[exif["SensingMethod"]]
+ if "SceneCaptureType" in exif and exif["SceneCaptureType"] < len(self._metadata.scene_capture_type_list):
+ self._attributes["sceneCaptureType"] = self._metadata.scene_capture_type_list[exif["SceneCaptureType"]]
+ if "SubjectDistanceRange" in exif and exif["SubjectDistanceRange"] < len(self._metadata.subject_distance_range_list):
+ self._attributes["subjectDistanceRange"] = self._metadata.subject_distance_range_list[exif["SubjectDistanceRange"]]
if "ExposureCompensation" in exif:
self._attributes["exposureCompensation"] = exif["ExposureCompensation"]
if "ExposureBiasValue" in exif:
@@ -203,9 +216,13 @@ class Photo(object):
self._attributes["dateTime"] = exif["DateTime"]
_metadata.flash_dictionary = {0x0: "No Flash", 0x1: "Fired",0x5: "Fired, Return not detected",0x7: "Fired, Return detected",0x8: "On, Did not fire",0x9: "On, Fired",0xd: "On, Return not detected",0xf: "On, Return detected",0x10: "Off, Did not fire",0x14: "Off, Did not fire, Return not detected",0x18: "Auto, Did not fire",0x19: "Auto, Fired",0x1d: "Auto, Fired, Return not detected",0x1f: "Auto, Fired, Return detected",0x20: "No flash function",0x30: "Off, No flash function",0x41: "Fired, Red-eye reduction",0x45: "Fired, Red-eye reduction, Return not detected",0x47: "Fired, Red-eye reduction, Return detected",0x49: "On, Red-eye reduction",0x4d: "On, Red-eye reduction, Return not detected",0x4f: "On, Red-eye reduction, Return detected",0x50: "Off, Red-eye reduction",0x58: "Auto, Did not fire, Red-eye reduction",0x59: "Auto, Fired, Red-eye reduction",0x5d: "Auto, Fired, Red-eye reduction, Return not detected",0x5f: "Auto, Fired, Red-eye reduction, Return detected"}
+ _metadata.light_source_dictionary = {0: "Unknown", 1: "Daylight", 2: "Fluorescent", 3: "Tungsten (incandescent light)", 4: "Flash", 9: "Fine weather", 10: "Cloudy weather", 11: "Shade", 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", 23: "D50", 24: "ISO studio tungsten"}
_metadata.metering_list = ["Unknown", "Average", "Center-weighted average", "Spot", "Multi-spot", "Multi-segment", "Partial"]
_metadata.exposure_list = ["Not Defined", "Manual", "Program AE", "Aperture-priority AE", "Shutter speed priority AE", "Creative (Slow speed)", "Action (High speed)", "Portrait", "Landscape", "Bulb"]
_metadata.orientation_list = ["Horizontal (normal)", "Mirror horizontal", "Rotate 180", "Mirror vertical", "Mirror horizontal and rotate 270 CW", "Rotate 90 CW", "Mirror horizontal and rotate 90 CW", "Rotate 270 CW"]
+ _metadata.sensing_method_list = ["Not defined", "One-chip color area sensor", "Two-chip color area sensor", "Three-chip color area sensor", "Color sequential area sensor", "Trilinear sensor", "Color sequential linear sensor"]
+ _metadata.scene_capture_type_list = ["Standard", "Landscape", "Portrait", "Night scene"]
+ _metadata.subject_distance_range_list = ["Unknown", "Macro", "Close view", "Distant view"]
def _thumbnail(self, image, thumb_path, original_path, size, square=False):
thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square))