WindowsIconReader.st
changeset 445 899af8ff2a5d
parent 430 50b841f4851d
child 518 c9d492fbb1b6
--- a/WindowsIconReader.st	Fri Feb 21 20:38:32 1997 +0100
+++ b/WindowsIconReader.st	Mon Feb 24 12:12:59 1997 +0100
@@ -201,17 +201,22 @@
     header := ByteArray uninitializedNew:8r110.
     aStream nextBytes:16 into:header.
 
-    (header startsWith:#(73 67)) ifTrue:[
+    (header startsWith:#(73 67)) ifTrue:[         "IC"
         "IC format"
         aStream nextBytes:10 into:header startingAt:17.
         width := header at:7.
         height := header at:9.
         inDepth := 2 "header at:11". "where is it"
     ] ifFalse:[
-        aStream nextBytes:(8r110-16) into:header startingAt:17.
-        width := header at:8r101.
-        height := header at:8r103.
-        inDepth := header at:8r107.
+        (header startsWith:#(67 73)) ifTrue:[     "CI"
+            self error:'unsupported format: CI'.
+            ^ nil.
+        ] ifFalse:[
+            aStream nextBytes:(8r110-16) into:header startingAt:17.
+            width := header at:8r101.
+            height := header at:8r103.
+            inDepth := header at:8r107.
+        ]
     ].
 
     "read the colormap"
@@ -292,7 +297,7 @@
     "
 
     "Modified: 17.9.1995 / 18:49:24 / claus"
-    "Modified: 23.4.1996 / 13:09:40 / cg"
+    "Modified: 24.2.1997 / 12:11:39 / cg"
 !
 
 fromStream:aStream 
@@ -324,6 +329,13 @@
         aStream position:1.
 "/        'WinIconReader [info]: OS/2 vsn 2 BA format' infoPrintNL.
         ^ self fromOS2Stream:aStream
+    ].                    
+    (header startsWith:#(67 73)) ifTrue:[     "CI"
+        'WinIconReader [warning]: OS/2 CI format not supported:' infoPrintNL.
+        ^ nil.
+        aStream position:1.
+"/        'WinIconReader [info]: OS/2 vsn 2 BA format' infoPrintNL.
+        ^ self fromOS2Stream:aStream
     ].
     (header startsWith:#(73 67)) ifTrue:[     "IC"
         aStream position:1.
@@ -336,10 +348,10 @@
         ^ self fromOS2Stream:aStream
     ].
     (header startsWith:#(16r53 16r5A)) ifTrue:[     "SZ"
-        'WinIconReader [warning]: SZ format not supported:' infoPrintNL.
+        'WinIconReader [warning]: OS/2 SZ format not supported:' infoPrintNL.
         ^ nil.
         aStream position:1.
-        'WinIconReader [info]: OS/2 PT format' infoPrintNL.
+        'WinIconReader [info]: OS/2 SZ format' infoPrintNL.
         ^ self fromOS2Stream:aStream
     ].
     (header startsWith:#(0 0 1 0)) ifTrue:[
@@ -358,7 +370,7 @@
     "
 
     "Modified: 17.9.1995 / 18:59:07 / claus"
-    "Modified: 28.1.1997 / 01:48:31 / cg"
+    "Modified: 24.2.1997 / 12:12:41 / cg"
 !
 
 fromWindowsBMPFile: aFilename 
@@ -648,6 +660,6 @@
 !WindowsIconReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.29 1997-02-17 10:10:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.30 1997-02-24 11:12:59 cg Exp $'
 ! !
 WindowsIconReader initialize!