--- a/PCXReader.st Tue Feb 03 17:58:02 1998 +0100
+++ b/PCXReader.st Tue Feb 03 18:00:06 1998 +0100
@@ -117,20 +117,20 @@
fileSize := aStream size.
fileSize < 128 ifTrue:[
- self error:'PCXREADER: short file'.
- ^ nil
+ ^ self fileFormatError:'short file'.
].
header := ByteArray uninitializedNew:128.
aStream nextBytes:128 into:header.
(self class isValidPCXHeader:header) ifFalse:[
- self error:'PCXREADER: wrong header'.
- ^ nil
+ ^ self fileFormatError:'wrong header'.
].
img := self fromStreamWithHeader:header.
^ img
+
+ "Modified: / 3.2.1998 / 17:58:17 / cg"
!
fromStreamWithHeader:header
@@ -181,8 +181,7 @@
compression := header at:3.
"/ 'compression=' print. compression printNL.
(#(0 1) includes:compression) ifFalse:[
- self error:'PCXREADER: unknown compression'.
- ^ nil
+ ^ self fileFormatError:'unknown compression'.
].
inDepth := header at:4.
@@ -199,10 +198,9 @@
So its not (yet) implemented
"
((inDepth ~~ 8) or:[nPlanes ~~ 1]) ifTrue:[
- 'PCXReader: depth: ' errorPrint. inDepth errorPrint.
- ' planes:' errorPrint. nPlanes errorPrintNL.
- 'PCXReader: can only handle 1-plane 256 color images' errorPrintNL.
- ^ nil
+"/ 'PCXReader: depth: ' errorPrint. inDepth errorPrint.
+"/ ' planes:' errorPrint. nPlanes errorPrintNL.
+ ^ self fileFormatError:'can only handle 1-plane 256 color images'.
].
xmin := header wordAt:5 MSB:false.
@@ -357,12 +355,12 @@
i inspect.
"
- "Modified: 24.4.1997 / 22:15:18 / cg"
+ "Modified: / 3.2.1998 / 17:59:03 / cg"
! !
!PCXReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/PCXReader.st,v 1.24 1997-06-30 20:56:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/PCXReader.st,v 1.25 1998-02-03 16:59:27 cg Exp $'
! !
PCXReader initialize!