[FIX] ImageReaderDepFix-nk

Stephane Ducasse ducasse at iam.unibe.ch
Wed Jul 9 07:18:45 UTC 2003


Thanks ned.

I checked because I was surprised that I could have left senders not 
fixed on a so trivial case (but nodboyd is perfect especially with kids 
around). In my image after KCP changes there were *no* senders to 
imageReaderClass, jpegReaderClass and  gifReaderClass.
I agree that the comments were bad (but not random ;). I should stop to 
work too late.


Then your changes break when the class JPEGReader is not present. This 
is not a problem but this was not the intention
of the original and stupid messages in Smalltalk

httpJpeg: url
	"Fetch the given URL, parse it using the JPEG reader, and return the 
resulting Form."

	| doc ggg |
	doc _ self httpGet: url.
	doc binary; reset.
	(ggg _ JPEGReadWriter new) setStream: doc.
	^ ggg nextImage.

My solution was not sexy but it conserved the original idea that the 
JPEGReaderClass could not be present in
the system. For my point of view I do not care too much because those 
aspects should be resolved using class extension
and packages. So I just say it to show that our design skills are not 
only random.

Here was my version:

httpJpeg: url
	"Fetch the given URL, parse it using the JPEG reader, and return the 
resulting Form."

	| doc ggg classOrNil |
	doc _ self httpGet: url.
	doc binary; reset.
	classOrNil := Smalltalk at: #JPEGReadWriter ifAbsent: [nil].
	classOrNil
		ifTrue: [self error: 'The JPEG reader is not available' . ^self].
	(ggg _ classOrNil new) setStream: doc.
	^ ggg nextImage.


So your changes are ok with me. I just checked to understand what I 
could have did wrong on this stupid
case.


Stef



On Tuesday, July 8, 2003, at 04:41 AM, ned at bike-nomad.com wrote:

> from preamble:
>
> "Change Set:		ImageReaderDepFix-nk
> Date:			7 July 2003
> Author:			Ned Konz
>
> This is a fix for three deprecated methods in SystemDictionary
> (imageReaderClass, gifReaderClass, and jpegReaderClass) that offered no
> suggestion as to alternatives.
>
> And it also fixes their callers to refer directly to the classes in
> question.
> "!
> <ImageReaderDepFix-nk.cs.gz>



More information about the Squeak-dev mailing list