--- a/ImageEditor.st Sat May 08 20:59:28 1999 +0200
+++ b/ImageEditor.st Sat May 08 21:02:24 1999 +0200
@@ -2600,9 +2600,11 @@
doLoadFromClass
"opens a dialog for loading an image from class and a (resource-) selector"
+ |img|
+
(imageEditView loadFromClass) notNil ifTrue:[
- self image notNil ifTrue: [
- self listOfColors contents: self image usedColors asSet asOrderedCollection.
+ (img := self image) notNil ifTrue: [
+ self listOfColors contents: img usedColors asSet asOrderedCollection.
self findColorMapMode.
self updateLabelsAndHistory
] ifFalse: [
@@ -2614,10 +2616,12 @@
doLoadFromFile
"opens a dialog for loading an image from a file"
+ |img|
+
self loadFromFile:
(FileSelectionBrowser
request: 'Load Image From'
- fileName: (self image notNil ifTrue: [self image fileName] ifFalse: [nil])
+ fileName: ((img := self image) notNil ifTrue: [img fileName] ifFalse: [nil])
withFileFilters: FileSelectionBrowser loadImageFileNameFilters)
!
@@ -2672,9 +2676,9 @@
image := Image fromUser.
image isNil ifFalse:[
image depth > 8 ifTrue:[
- Object errorSignal handle:[:ex |
- ex signal == Object haltSignal ifTrue:[ex reject].
- ex signal == Signal noHandlerSignal ifTrue:[ex reject].
+ Object errorSignal handle:[:ex | |sig|
+ (sig := ex signal) == Object haltSignal ifTrue:[ex reject].
+ sig == Signal noHandlerSignal ifTrue:[ex reject].
self warn:'Could not convert to depth8 image (too many colors)'.
d8image := nil.