Karl Ramberg uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-kfr.305.mcz==================== Summary ====================
Name: Graphics-kfr.305
Author: kfr
Time: 11 January 2015, 12:19:12.738 am
UUID: ad7be66f-dd0c-8443-b773-b96836359b05
Ancestors: Graphics-kfr.304
Nil return if stream atEnd true
=============== Diff against Graphics-kfr.304 ===============
Item was changed:
----- Method: GIFReadWriter>>readBody (in category 'private-decoding') -----
readBody
"Read the GIF blocks. Modified to return a form. "
| form extype block blocksize packedFields delay1 |
form := nil.
[stream atEnd] whileFalse: [
block := self next.
block = Terminator ifTrue: [^ form].
block = ImageSeparator ifTrue: [
form isNil
ifTrue: [form := self readBitData]
ifFalse: [self skipBitData].
] ifFalse: [
block = Extension
ifFalse: [^ form "^ self error: 'Unknown block type'"].
"Extension block"
extype := self next. "extension type"
extype = 16rF9 ifTrue: [ "graphics control"
self next = 4 ifFalse: [^ form "^ self error: 'corrupt GIF file'"].
"====
Reserved 3 Bits
Disposal Method 3 Bits
User Input Flag 1 Bit
Transparent Color Flag 1 Bit
==="
packedFields := self next.
delay1 := self next. "delay time 1"
delay := (self next*256 + delay1) *10. "delay time 2"
transparentIndex := self next.
(packedFields bitAnd: 1) = 0 ifTrue: [transparentIndex := nil].
self next = 0 ifFalse: [^ form "^ self error: 'corrupt GIF file'"].
] ifFalse: [
"Skip blocks"
[(blocksize := self next) > 0]
whileTrue: [
"Read the block and ignore it and eat the block terminator"
+ self next: blocksize]]]].
+ ^nil!
- self next: blocksize]]]]!