Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: ImageObserver.ABORT

Reply
Thread Tools

Re: ImageObserver.ABORT

 
 
Roedy Green
Guest
Posts: n/a
 
      07-22-2003
On Tue, 22 Jul 2003 12:27:26 -0500, Charles Thomas
<cthomas@REMOVE_SPAM_BLOCK.facstaff.wisc.edu> wrote or quoted :

>I'm loading a jpeg from a JAR file and I'm getting this thrown during
>image loading.


I'm guessing:

1. invalid format file. Improperly formatted JPEG. Check images with
PSP to make sure they are ok.

2. source of images closing channel before image has been fully
delivered.

3. invalid URL format. See http://mindprod.com/jgloss/image.html
Must be precisely correct in case including subdir.

4. failure to MediaTrack.


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
Charles Thomas
Guest
Posts: n/a
 
      07-22-2003
> 1. invalid format file. Improperly formatted JPEG. Check images with
> PSP to make sure they are ok.


Images load fine in OS9 and from within Codewarrior on OSX. When I make
a stand-alone app using Jar Bundler, however, I get these errors. None
of the images load properly any longer once the stand-alone app is made.
The images ARE intact in the JAR file. I can extract them and open them
fine using Photoshop or whatever.

What is PSP?

Could the fact that they're named "*.jpeg" have anyhing to do with it?
One cannot add a jpeg file to Codewarrior unless it's named ".jpeg", but
OSX I think likes things to be named ".jpg". A paradox, methinks.

> 2. source of images closing channel before image has been fully
> delivered.


Any idea how to remedy this when reading images from a JAR file? I'll
attach my loading code below.

> 3. invalid URL format. See http://mindprod.com/jgloss/image.html
> Must be precisely correct in case including subdir.


Don't think this is the case since it's finding the image and returning
the Image object as non-null; it just seems unable to load it
subsequently.

> 4. failure to MediaTrack.


I am using MediaTracker, which returns errors when I call:

Object[] errors = media_tracker.getErrorsAny();

But I don't know how do access these errors to get additional
information from them. My documentation just calls them "Objects", and
frankly I'm not sure how to do anything with them besides just see that
they're there by seeing if "errors" is non-null.

Thanks for the reply, Reody.

CT

//====== CODE FOLLOWS
url = getClass().getResource("Images/Title_image.jpeg");
if (url != null)
{
img = Toolkit.getDefaultToolkit().getImage(url);
}

if (img != null)
{
mt = new MediaTracker(this);
mt.addImage(img, 0);
try
{
mt.waitForAll();
}
catch (InterruptedException ie){}

Object[] errors = mt.getErrorsAny();
if (errors != null)
{
displayMessage("Errors were generated during title image
loading!");
}

}
else
Settings.main_window.displayMessage("Unable to load title image.");
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments