#BUGFIX
authormatilk
Mon, 22 Feb 2016 16:04:24 +0100
changeset 3568 a8900d28752b
parent 3565 76899d7114cd
child 3569 db33d39f3c93
child 3570 5ea6c93102cf
#BUGFIX class: WindowsIconReader changed: #fromWindowsICOStream:alreadyRead: support reading rgba depth32 images.
WindowsIconReader.st
--- a/WindowsIconReader.st	Thu Feb 18 13:47:37 2016 +0100
+++ b/WindowsIconReader.st	Mon Feb 22 16:04:24 2016 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libview2' }"
 
+"{ NameSpace: Smalltalk }"
+
 ImageReader subclass:#WindowsIconReader
 	instanceVariableNames:'compression inDepth'
 	classVariableNames:''
@@ -1046,6 +1048,24 @@
         srcIndex := srcIndex + bytesPerRow.
         dstIndex := dstIndex - bytesPerRow.
     ].
+
+    inDepth == 32 ifTrue:[
+        srcIndex := 1.
+        1 to:height do:[:row |
+            1 to:width do:[:row |
+                |b1 b2 b3 b4|
+                b1 := tmp at:srcIndex.
+                b2 := tmp at:srcIndex+1.
+                b3 := tmp at:srcIndex+2.
+                b4 := tmp at:srcIndex+3.
+                tmp at:srcIndex put:b3.
+                tmp at:srcIndex+2 put:b1.
+                
+                srcIndex := srcIndex + 4.
+            ].
+        ].
+    ].
+
     rawData := tmp.
 
     nColor > 0 ifTrue:[
@@ -1318,11 +1338,11 @@
 !WindowsIconReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $'
+    ^ '$Header$'
 ! !