[Q] Directory of images

Brian Brown rbb at techgame.net
Mon Apr 7 16:37:11 UTC 2003


I used the following code in a workspace to read in a directory of GIF 
files and put them in
the ImageImports collection... I read through the Swiki and FileList2 
to figure out how the "Import" button worked...
Unfortunately, the images seems a bit corrupted... Is there some other 
way I should do this?

dirName _ (FileDirectory default pathName), slash, 'bryant', slash, 
'images', slash.
dir _ FileDirectory on: dirName.

dir fileNames withIndexDo: [:fname :fid | (fname asLowercase endsWith: 
'.gif')
	ifTrue: [
		key _ fname sansPeriodSuffix.
		image _ Form fromFileNamed: dirName, fname.
		Smalltalk imageImports at: key put: image.]
    ]


Thanks!

Brian



More information about the Squeak-dev mailing list