allow reading from ByteArray-readStreams
authorClaus Gittinger <cg@exept.de>
Fri, 13 Sep 1996 18:45:31 +0200
changeset 331 304f9c439efa
parent 330 d7ce98930ad3
child 332 86b45e0f9ec0
allow reading from ByteArray-readStreams
GIFReader.st
TIFFRdr.st
TIFFReader.st
--- a/GIFReader.st	Tue Sep 10 00:58:38 1996 +0200
+++ b/GIFReader.st	Fri Sep 13 18:45:31 1996 +0200
@@ -142,8 +142,9 @@
     "GIF-files are always lsb (intel-world)"
     byteOrder := #lsb.
 
-    id := String new:6.
-    aStream nextBytes:6 into:id.
+    id := ByteArray new:6.
+    aStream nextBytes:6 into:id startingAt:1.
+    id := id asString.
 
     "all I had for testing where GIF87a files;
      I hope later versions work too ..."
@@ -324,8 +325,8 @@
      GIFReader fromFile:'../fileIn/bitmaps/garfield.gif'
     "
 
-    "Modified: 5.7.1996 / 12:32:33 / cg"
     "Modified: 5.7.1996 / 17:32:01 / stefan"
+    "Modified: 13.9.1996 / 18:41:06 / cg"
 !
 
 makeGreyscale
@@ -461,6 +462,6 @@
 !GIFReader  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.39 1996-07-05 21:07:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.40 1996-09-13 16:45:31 cg Exp $'
 ! !
 GIFReader initialize!
--- a/TIFFRdr.st	Tue Sep 10 00:58:38 1996 +0200
+++ b/TIFFRdr.st	Fri Sep 13 18:45:31 1996 +0200
@@ -1412,6 +1412,7 @@
      result offset ok msb|
 
     inStream := aStream.
+    aStream binary.
 
     char1 := aStream next.
     char2 := aStream next.
@@ -1419,11 +1420,11 @@
         'TIFFReader: not a tiff file' errorPrintNL.
         ^ nil
     ].
-    (char1 == $I) ifTrue:[
+    (char1 == $I asciiValue) ifTrue:[
         byteOrder := #lsb.
         msb := false.
     ] ifFalse:[
-        (char1 == $M) ifTrue:[
+        (char1 == $M asciiValue) ifTrue:[
             byteOrder := #msb.
             msb := true.
         ] ifFalse:[
@@ -1432,8 +1433,6 @@
         ]
     ].
 
-    aStream binary.
-
     version := self readShort.
     (version ~~ 42) ifTrue:[
         'TIFFReader: version of tiff-file not supported' errorPrintNL.
@@ -1561,7 +1560,7 @@
     ].
     ^ result
 
-    "Modified: 22.4.1996 / 19:12:12 / cg"
+    "Modified: 13.9.1996 / 18:43:01 / cg"
 ! !
 
 !TIFFReader methodsFor:'writing to file'!
@@ -1657,6 +1656,6 @@
 !TIFFReader  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/TIFFRdr.st,v 1.39 1996-09-05 15:37:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/TIFFRdr.st,v 1.40 1996-09-13 16:45:14 cg Exp $'
 ! !
 TIFFReader initialize!
--- a/TIFFReader.st	Tue Sep 10 00:58:38 1996 +0200
+++ b/TIFFReader.st	Fri Sep 13 18:45:31 1996 +0200
@@ -1412,6 +1412,7 @@
      result offset ok msb|
 
     inStream := aStream.
+    aStream binary.
 
     char1 := aStream next.
     char2 := aStream next.
@@ -1419,11 +1420,11 @@
         'TIFFReader: not a tiff file' errorPrintNL.
         ^ nil
     ].
-    (char1 == $I) ifTrue:[
+    (char1 == $I asciiValue) ifTrue:[
         byteOrder := #lsb.
         msb := false.
     ] ifFalse:[
-        (char1 == $M) ifTrue:[
+        (char1 == $M asciiValue) ifTrue:[
             byteOrder := #msb.
             msb := true.
         ] ifFalse:[
@@ -1432,8 +1433,6 @@
         ]
     ].
 
-    aStream binary.
-
     version := self readShort.
     (version ~~ 42) ifTrue:[
         'TIFFReader: version of tiff-file not supported' errorPrintNL.
@@ -1561,7 +1560,7 @@
     ].
     ^ result
 
-    "Modified: 22.4.1996 / 19:12:12 / cg"
+    "Modified: 13.9.1996 / 18:43:01 / cg"
 ! !
 
 !TIFFReader methodsFor:'writing to file'!
@@ -1657,6 +1656,6 @@
 !TIFFReader  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/TIFFReader.st,v 1.39 1996-09-05 15:37:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/TIFFReader.st,v 1.40 1996-09-13 16:45:14 cg Exp $'
 ! !
 TIFFReader initialize!