#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Thu, 31 Aug 2017 18:16:44 +0200
changeset 8146 97a4ee050bd6
parent 8145 83f792c6d9b1
child 8147 4451c94e3e41
#UI_ENHANCEMENT by cg class: ImageReader changed: #bitsPerPixel
ImageReader.st
--- a/ImageReader.st	Thu Aug 31 18:02:57 2017 +0200
+++ b/ImageReader.st	Thu Aug 31 18:16:44 2017 +0200
@@ -2395,8 +2395,18 @@
 bitsPerPixel
     "return the number of bits per pixel"
 
+    "/ if depth was given, that is what we use;
+    "/ otherwise, compute from bitsPerSample.
+    "/ notice, that depth is >= sum(bitsPerSample),
+    "/ for example, in a 16bit image, we mght have
+    "/ depth == 16 and bitsPerSample = 5+5+5,
+    
+    depth notNil ifTrue:[^ depth].
+    
     bitsPerSample isNil ifTrue:[^ nil].
     ^ bitsPerSample sum
+
+    "Modified (format): / 31-08-2017 / 18:09:59 / cg"
 !
 
 bitsPerRow