Image.st
changeset 8729 ac6b7e021151
parent 8726 b90ede922f20
child 8745 2ebd0e6febc9
--- a/Image.st	Fri Jul 12 15:21:15 2019 +0200
+++ b/Image.st	Fri Jul 12 15:22:55 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
               All Rights Reserved
@@ -4954,20 +4952,18 @@
         ].
     ].
 
-    "/ a hack, for now - alpha is in the low-byte !!!!!!
     (myDepth == 24 and:[otherDepth == 32]) ifTrue:[
-        ((samePhotometric and:[photometric == #rgb])
-          or:[ (photometric == #rgb and:[otherPhotometric == #argb]) ]
-        ) ifTrue:[
-            "/ can do the bits by simple stripping off the alpha channel
-            self copyPixels32AlphaLowTo24From:anImage.
-            ^ self
-        ].
-        (photometric == #rgb and:[otherPhotometric == #rgba])
-        ifTrue:[
-            "/ can do the bits by simple stripping off the alpha channel
-            self copyPixels32AlphaHighTo24From:anImage.
-            ^ self
+        (photometric == #rgb) ifTrue:[ "/ target-photometric
+            (otherPhotometric == #argb) ifTrue:[
+                "/ low byte is alpha, to be ignored
+                self copyPixels32AlphaLowTo24From:anImage.
+                ^ self
+            ].
+            ((otherPhotometric == #rgb) or:[otherPhotometric == #rgba]) ifTrue:[
+                "/ high byte is alpha, to be ignored
+                self copyPixels32AlphaHighTo24From:anImage.
+                ^ self
+            ].
         ].
     ].
 
@@ -5016,6 +5012,7 @@
     "Modified (format): / 30-01-2017 / 20:46:22 / stefan"
     "Modified: / 24-08-2017 / 17:28:25 / cg"
     "Modified: / 25-03-2019 / 14:43:27 / Claus Gittinger"
+    "Modified: / 12-07-2019 / 14:25:48 / Stefan Reise"
 !
 
 fromSubImage:anImage in:aRectangle