JDK-4198073 : compressed gif not loading from jar file
  • Type: Bug
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-12-16
  • Updated: 1999-03-13
  • Resolved: 1999-03-13
Related Reports
Duplicate :  
Description

Name: dbT83986			Date: 12/16/98


public static Image getImage (String imageFileName, Component component)
{
  Image img = null;
  try
  {
     MediaTracker tracker = new MediaTracker (component);
     InputStream in = component.getClass ().getResourceAsStream (imageFileName);
     if (in == null)
     {
	System.out.println ("Image " + imageFileName + " not found.");
	return null;
     }
     byte[] buffer = new byte[in.available ()];
     in.read (buffer);

     img = Toolkit.getDefaultToolkit ().createImage (buffer);
     tracker.addImage (img, 0);
     tracker.waitForID (0);
     if (tracker.statusID () == tracker.ERRORED)
        System.out.println ("Error loading image");
   }
   catch (java.io.IOException ex)
   {
     System.out.println ("Unable to read image.");
   }
   catch (InterruptedException ex)	{}
   return img;
}

Above code is used to load gif image into application
imageFileName is image path. Let me enumerate now 
when it works:
in applet deployed to compressed jar in Netscape4.05+/IE4.01
in application not deployed to jar with JRE 1.1.5+/JRE 1.2
in application deployed to compressed jar with JRE 1.1.5+.

It does not work from compressed jar with JRE 1.2. 
Trackers return ERRORED in such case. What we've 
additionally found out, is that, if we have whole 
jar compressed, but gifs inside uncompressed - 
it works fine. 

Other words: compressed gif deployed to jar isn't
loading properly with JRE1.2. It used to load with
JRE 1.1 and browsers VMs.
(Review ID: 47712)
======================================================================

Comments
WORK AROUND Name: dbT83986 Date: 12/16/98 1. Don't deploy to jar 2. Deploy to uncompressed jar 3. Deploy to compressed jar with gifs uncompressed ======================================================================
11-06-2004

EVALUATION Sounds more like a jar problem. Reassigning to classes_util for further investigation. david.mendenhall@eng 1999-01-06
06-01-1999