[squeak-dev] The Trunk: Graphics-mt.300.mcz

Levente Uzonyi leves at elte.hu
Fri Aug 15 02:45:25 UTC 2014


On Tue, 12 Aug 2014, commits at source.squeak.org wrote:

> Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-mt.300.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-mt.300
> Author: mt
> Time: 12 August 2014, 10:04:47.352 am
> UUID: 6462eee8-e43a-4840-954c-edc02dfcd8ee
> Ancestors: Graphics-nice.299
>
> fixed image reading: stream was not correctly reset for each reader/writer test

IIRC this is what Nicolas was trying to get rid of. Actually restoring the 
stream is a must, but #reset will set its position to 0, while the 
original position could have been anything. I kinda think that restoring 
the stream's position belongs to where it's changed (#understandsImageFormat:).


Levente

>
> =============== Diff against Graphics-nice.299 ===============
>
> Item was changed:
>  ----- Method: ImageReadWriter class>>formFromStream: (in category 'image reading/writing') -----
>  formFromStream: aBinaryStream
>  	"Answer a ColorForm stored on the given stream.  closes the stream"
>  	| reader readerClass form  |
>
>  	readerClass := self withAllSubclasses
> + 		detect: [:subclass |
> + 			aBinaryStream reset.
> + 			subclass understandsImageFormat: aBinaryStream]
> - 		detect: [:subclass | subclass understandsImageFormat: aBinaryStream]
>  		ifNone: [
>  			aBinaryStream close.
>  			^self error: 'image format not recognized'].
>  	aBinaryStream reset.
>  	reader := readerClass new on: aBinaryStream.
>  	Cursor read showWhile: [
>  		form := reader nextImage.
>  		reader close].
>  	^ form
>  !
>
>
>


More information about the Squeak-dev mailing list