In Shelf.createImage, refuse to recognize images we can't convert to
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 3 Sep 2004 22:15:57 +0000 (22:15 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 3 Sep 2004 22:15:57 +0000 (22:15 +0000)
RGB mode later.

src/lib/kofoto/shelf.py

index 62c12b0..f20e89b 100644 (file)
@@ -747,11 +747,11 @@ class Shelf:
         import Image as PILImage
         try:
             pilimg = PILImage.open(path)
+            if not pilimg.mode in ("L", "RGB", "CMYK"):
+                pilimg = pilimg.convert("RGB")
 #        except IOError:
         except: # Work-around for buggy PIL.
             raise NotAnImageError, path
-        if pilimg.format == "MPEG":
-            raise NotAnImageError, path
         width, height = pilimg.size
         location = unicode(os.path.realpath(path.encode(self.codeset)),
                            self.codeset)