Project

General

Profile

Actions

Bug #4123

closed

Image reader can't read URL

Added by Chris Weed over 15 years ago. Updated over 15 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());
}

Actions #1

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.

Actions #2

Updated by Chris Weed over 15 years ago

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

Actions #3

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.

Actions #4

Updated by Redmine Admin over 11 years ago

Original Bugzilla ID was 4123

Actions

Also available in: Atom PDF