Project

General

Profile

Bug #4123

Image reader can't read URL

Added by Chris Weed about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
actors
Target version:
Start date:
06/02/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4123

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());
}

History

#1 Updated by Chris Weed about 10 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.

#2 Updated by Chris Weed about 10 years ago

I meant "ImageReader" instead of "FileReader" in my comment

#3 Updated by Christopher Brooks about 10 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.

#4 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4123

Also available in: Atom PDF