raise informationLostSignal before attemting to write the file
authorClaus Gittinger <cg@exept.de>
Thu, 01 Oct 1998 12:50:21 +0200
changeset 1078 fc33e172bbbc
parent 1077 a32174ae0374
child 1079 15ffea561117
raise informationLostSignal before attemting to write the file (avoid clobbering the file in case of an abort from an ex-handler)
PBMReader.st
TIFFRdr.st
TIFFReader.st
--- a/PBMReader.st	Fri Sep 25 20:23:19 1998 +0200
+++ b/PBMReader.st	Thu Oct 01 12:50:21 1998 +0200
@@ -479,6 +479,12 @@
 
     |bitsPerPixel|
 
+    image mask notNil ifTrue:[
+        Image informationLostQuerySignal
+            raiseWith:image
+            errorString:('PBM format does not support an imageMask').
+    ].
+
     outStream := FileStream newFileNamed:aFileName.
     outStream isNil ifTrue:[
         'PBMReader [error]: file create error' errorPrintNL. 
@@ -487,12 +493,6 @@
             errorString:('file creation error: ' , aFileName asString).
     ].
 
-    image mask notNil ifTrue:[
-        Image informationLostQuerySignal
-            raiseWith:image
-            errorString:('PBM format does not support an imageMask').
-    ].
-
     width := image width.
     height := image height.
     photometric := image photometric.
@@ -539,7 +539,7 @@
      img inspect.
     "
 
-    "Modified: 14.10.1997 / 19:41:59 / cg"
+    "Modified: / 30.9.1998 / 23:30:43 / cg"
 !
 
 writeCommonHeader:format on:aStream
@@ -650,6 +650,6 @@
 !PBMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/PBMReader.st,v 1.35 1998-09-08 11:21:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/PBMReader.st,v 1.36 1998-10-01 10:50:21 cg Exp $'
 ! !
 PBMReader initialize!
--- a/TIFFRdr.st	Fri Sep 25 20:23:19 1998 +0200
+++ b/TIFFRdr.st	Thu Oct 01 12:50:21 1998 +0200
@@ -2101,6 +2101,12 @@
 
     |pos1 pos|
 
+    image mask notNil ifTrue:[
+        Image informationLostQuerySignal
+            raiseWith:image
+            errorString:('TIFF writer does not (yet) support an imageMask').
+    ].
+
     outStream := FileStream newFileNamed:aFileName.
     outStream isNil ifTrue:[
         ^ Image fileCreationErrorSignal 
@@ -2108,12 +2114,6 @@
             errorString:('file creation error: ' , aFileName asString).
     ].
 
-    image mask notNil ifTrue:[
-        Image informationLostQuerySignal
-            raiseWith:image
-            errorString:('TIFF writer does not (yet) support an imageMask').
-    ].
-
     "save as msb"
 
     byteOrder := #msb.
@@ -2190,12 +2190,12 @@
     self writeLong:0.                "end of tags mark"
     outStream close
 
-    "Modified: 27.2.1997 / 12:46:26 / cg"
+    "Modified: / 30.9.1998 / 23:30:18 / cg"
 ! !
 
 !TIFFReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/TIFFRdr.st,v 1.61 1998-08-12 12:04:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/TIFFRdr.st,v 1.62 1998-10-01 10:49:33 cg Exp $'
 ! !
 TIFFReader initialize!
--- a/TIFFReader.st	Fri Sep 25 20:23:19 1998 +0200
+++ b/TIFFReader.st	Thu Oct 01 12:50:21 1998 +0200
@@ -2101,6 +2101,12 @@
 
     |pos1 pos|
 
+    image mask notNil ifTrue:[
+        Image informationLostQuerySignal
+            raiseWith:image
+            errorString:('TIFF writer does not (yet) support an imageMask').
+    ].
+
     outStream := FileStream newFileNamed:aFileName.
     outStream isNil ifTrue:[
         ^ Image fileCreationErrorSignal 
@@ -2108,12 +2114,6 @@
             errorString:('file creation error: ' , aFileName asString).
     ].
 
-    image mask notNil ifTrue:[
-        Image informationLostQuerySignal
-            raiseWith:image
-            errorString:('TIFF writer does not (yet) support an imageMask').
-    ].
-
     "save as msb"
 
     byteOrder := #msb.
@@ -2190,12 +2190,12 @@
     self writeLong:0.                "end of tags mark"
     outStream close
 
-    "Modified: 27.2.1997 / 12:46:26 / cg"
+    "Modified: / 30.9.1998 / 23:30:18 / cg"
 ! !
 
 !TIFFReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/TIFFReader.st,v 1.61 1998-08-12 12:04:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/TIFFReader.st,v 1.62 1998-10-01 10:49:33 cg Exp $'
 ! !
 TIFFReader initialize!