XBMReader.st
changeset 461 bacef118f54a
parent 399 f87821ab7b30
child 493 d6392d88c552
--- a/XBMReader.st	Thu Feb 27 12:05:52 1997 +0100
+++ b/XBMReader.st	Thu Feb 27 12:50:58 1997 +0100
@@ -228,14 +228,22 @@
      rowBytes "{ Class: SmallInteger }" |
 
     (self class canRepresent:image) ifFalse:[
-        self error:'can only save depth 1 B&W images'.
-        ^ nil.
+        ^ Image cannotRepresentImageSignal 
+            raiseWith:image
+            errorString:('XBM format only supports monochrome images').
+    ].
+
+    image mask notNil ifTrue:[
+        Image informationLostQuerySignal
+            raiseWith:image
+            errorString:('XBM format does not support an imageMask').
     ].
 
     outStream := FileStream newFileNamed:aFileName.
     outStream isNil ifTrue:[
-        'XBMReader [error]: create error' errorPrintCR. 
-        ^ nil
+        ^ Image fileCreationErrorSignal 
+            raiseWith:image
+            errorString:('file creation error: ' , aFileName asString).
     ].
 
     width := image width.
@@ -288,12 +296,12 @@
      XBMReader save:(Image fromFile:'bitmaps/hello_world.icon') onFile:'test.xbm'
     "
 
-    "Modified: 10.1.1997 / 18:16:47 / cg"
+    "Modified: 27.2.1997 / 12:46:49 / cg"
 ! !
 
 !XBMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.30 1997-02-01 14:08:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.31 1997-02-27 11:49:56 cg Exp $'
 ! !
 XBMReader initialize!