GIFReader.st
changeset 2056 b7eea50081f2
parent 2032 cf3b4dcc4ad3
child 2595 37dc71e1e59b
--- a/GIFReader.st	Wed Jul 27 10:31:43 2005 +0200
+++ b/GIFReader.st	Fri Aug 05 14:45:04 2005 +0200
@@ -419,24 +419,27 @@
 assignTransparentPixelIn:image
     "find an usused pixelValue in the colorMap (or image)."
 
-    |cmap usedPixelValues|
+    |cmap usedPixelValues unusedValues|
 
     (cmap := image colorMap) size > 0 ifTrue:[
-	cmap size < 256 ifTrue:[
-	    maskPixel := cmap size.
-	    ^ self
-	]
+        cmap size < 256 ifTrue:[
+            maskPixel := cmap size.
+            ^ self
+        ]
     ].
 
     usedPixelValues := image usedValues.
-    usedPixelValues size < (1 bitShift:image depth) ifTrue:[
-	"/ there must be an unused pixelValue
-	maskPixel := ((0 to:(1 bitShift:image depth)-1) asSet removeAll:(usedPixelValues)) first.
-    ] ifFalse:[
-	Image informationLostQuerySignal
-	    raiseWith:image
-	    errorString:('GIF writer cannot assign a transparent pixel - all pixelValues used by image').
-    ]
+    usedPixelValues size < (1 bitShift:image depth) ifFalse:[
+        Image informationLostQuerySignal
+            raiseWith:image
+            errorString:('GIF writer cannot assign a transparent pixel - all pixelValues used by image').
+    ].
+
+    "/ there must be an unused pixelValue
+    unusedValues := (0 to:(1 bitShift:image depth)-1) asSet.
+    unusedValues removeAll:usedPixelValues.
+
+    maskPixel := unusedValues first.
 !
 
 checkCodeSize
@@ -978,7 +981,7 @@
 !GIFReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.92 2005-02-01 12:39:32 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.93 2005-08-05 12:45:04 cg Exp $'
 ! !
 
 GIFReader initialize!