Allow other transforms without losing 8-bit.
authorSimon Cross <hodgestar@gmail.com>
Fri, 16 May 2014 23:24:22 +0000 (01:24 +0200)
committerSimon Cross <hodgestar@gmail.com>
Fri, 16 May 2014 23:26:53 +0000 (01:26 +0200)
naja/widgets/image_box.py

index 5709cec6ba8817caffd3b92171311c37573ecbfa..32787dfce793d9813a904e899ba55cf81be2c0bd 100644 (file)
@@ -8,9 +8,11 @@ from naja.widgets.base import Widget
 class ImageBox(Widget):
     """Widget which holds an image."""
 
-    def __init__(self, pos, image, transforms=(EIGHT_BIT,)):
+    def __init__(self, pos, image, eight_bit=True, transforms=()):
         super(ImageBox, self).__init__(pos)
         self.image = image
+        if eight_bit:
+            transforms = (EIGHT_BIT,) + transforms
         self.transforms = transforms
 
     def prepare(self):