Bug #4123
closedImage reader can't read URL
0%
Description
In ptolemy.actor.lib.image.ImageReader
replace
_image = new ImageIcon(_fileRoot).getImage();
with:
try {
_image = ImageIO.read(_url);
} catch (IOException e) {
throw new IllegalActionException(this,e.toString());
}
if(!_image)
{
throw new IllegalActionException(this,"Could not read file or URL: "+_url.toString());
}
Updated by Chris Weed over 15 years ago
I just noticed URLToImage is similar to what I want. I guess my confusion was that the parameter in FileReader is fileOrUrl, but doesn't seem to work with a normal URL.
Updated by Chris Weed over 15 years ago
I meant "ImageReader" instead of "FileReader" in my comment
Updated by Christopher Brooks over 15 years ago
Fixed!
ImageReader is a very old actor, written in 2001.
The fileOrURL parameter was changed to a FileParameter in 2003.
I added a test for reading a URL via http:
Note that to get the change to the ptII tree today, you will need
to run some sort of ant command.