#OTHER
authorClaus Gittinger <cg@exept.de>
Mon, 05 Oct 2015 09:17:20 +0200
changeset 3230 e6d7ba2e0384
parent 3229 ba4c463b66ad
child 3231 1ac976f4c08d
#OTHER class: ImageEditor changed: #colorMapMode: 24bit conversion error
ImageEditor.st
--- a/ImageEditor.st	Thu Oct 01 09:45:36 2015 +0200
+++ b/ImageEditor.st	Mon Oct 05 09:17:20 2015 +0200
@@ -5281,10 +5281,14 @@
         prevMode := colorMapMode value.
 
         newColorMap := self class listOfColorMaps at:aMode.
-        aMode == #depth32 ifTrue:[
+        (aMode == #depth32 or:[aMode == #masked32]) ifTrue:[
             depth := 32. 
         ] ifFalse:[
-            depth := (newColorMap size log:2) asInteger. 
+            (aMode == #depth24 or:[aMode == #masked24]) ifTrue:[
+                depth := 24. 
+            ] ifFalse:[
+                depth := (newColorMap size log:2) asInteger. 
+            ].
         ].
 
         useNearest := false.
@@ -5391,6 +5395,17 @@
 
         newImage := Image newForDepth:depth.
         newImage depth:depth.
+        depth >= 16 ifTrue:[
+            depth == 32 ifTrue:[
+                newImage colorMap:nil.
+                newImage samplesPerPixel:4.
+                newImage photometric:#rgba.
+            ] ifFalse:[    
+                newImage colorMap:nil.
+                newImage samplesPerPixel:3.
+                newImage photometric:#rgb.
+            ].    
+        ].    
 "/        newImage photometric:oldImage photometric.
 
         oldFileName := oldImage fileName.