Ignore maker notes when parsing EXIF information to improve performance
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 25 Jul 2007 15:02:56 +0000 (17:02 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 25 Jul 2007 15:02:56 +0000 (17:02 +0200)
src/packages/kofoto/shelf.py
src/test/test_shelf.py

index 35af9e8..6ad70f3 100644 (file)
@@ -1957,8 +1957,9 @@ class ImageVersion:
         """
         from kofoto import EXIF
         image = self.getImage()
+        fp = open(self.getLocation(), "rb")
         try:
-            tags = EXIF.process_file(file(self.getLocation(), "rb"))
+            tags = EXIF.process_file(fp, details=False)
         except: # Work-around for buggy EXIF library.
             raise ExifImportError(self.getLocation())
 
@@ -2018,18 +2019,6 @@ class ImageVersion:
         value = tags.get("EXIF ExposureBiasValue")
         if value:
             image.setAttribute(u"exposurebias", unicode(value), overwrite)
-        value = tags.get("MakerNote SpecialMode")
-        if value:
-            image.setAttribute(u"specialmode", unicode(value), overwrite)
-        value = tags.get("MakerNote JPEGQual")
-        if value:
-            image.setAttribute(u"jpegquality", unicode(value), overwrite)
-        value = tags.get("MakerNote Macro")
-        if value:
-            image.setAttribute(u"macro", unicode(value), overwrite)
-        value = tags.get("MakerNote DigitalZoom")
-        if value:
-            image.setAttribute(u"digitalzoom", unicode(value), overwrite)
         self.shelf._setModified()
 
     ##############################
index aad3e16..c0d51bd 100755 (executable)
@@ -562,9 +562,8 @@ class TestShelfMethods(TestShelfFixture):
         attrnames = sorted(self.shelf.getAllAttributeNames())
         assert attrnames == [
             "cameramake", "cameramodel", "captured", "description",
-            "digitalzoom", "exposurebias", "exposureprogram", "exposuretime",
-            "flash", "fnumber", "focallength", "iso", "orientation", "query",
-            "title"
+            "exposurebias", "exposureprogram", "exposuretime", "flash",
+            "fnumber", "focallength", "iso", "orientation", "query", "title"
             ], attrnames
 
     def test_getCategory(self):