Re: ImageObserver.ABORT

Discussion in 'Java' started by Roedy Green, Jul 22, 2003.

  1. Roedy Green

    Roedy Green Guest

    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.
     
    Roedy Green, Jul 22, 2003
    #1
    1. Advertising

  2. > 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.");
     
    Charles Thomas, Jul 22, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Prasad Dannani

    Bulk Import - Thread was being Abort

    Prasad Dannani, Sep 1, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    541
    Prasad Dannani
    Sep 1, 2005
  2. OtisUsenet
    Replies:
    3
    Views:
    12,667
    OtisUsenet
    Feb 24, 2004
  3. Replies:
    5
    Views:
    1,591
    Roedy Green
    Aug 16, 2005
  4. Replies:
    1
    Views:
    13,131
    Knute Johnson
    Apr 18, 2006
  5. Replies:
    2
    Views:
    493
Loading...

Share This Page