Bug #4123
closed
Image reader can't read URL
Added by Chris Weed over 15 years ago.
Updated over 15 years ago.
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());
}
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.
I meant "ImageReader" instead of "FileReader" in my comment
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.
Original Bugzilla ID was 4123
Also available in: Atom
PDF