>Number: 285 >Category: protocol >Synopsis: Java 1.0.2 image loading program doesn't work for 1.2b7, but >does for 1.1.3 >Confidential: no >Severity: serious >Priority: medium >Responsible: apache (Apache HTTP Project) >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat Mar 29 10:50:00 1997 >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.2b7 >Environment: Ultrix 4.2, Solaris 2.5, gcc2.7.2 >Description: The program "ImageLoad.java" below fails to load a GIF or JPEG image file on the call
java ImageLoad http::<host>/<image-file> if the <host> is running Apache 1.2b7, but it works if running Apache 1.1.3. Errors look like protocol mistakes, saying the image is not a GIF or JPEG file. This problem was experienced on both Solaris and Ultrix running 1.2b7. Both work fine running 1.1.3. ---------------------------------------------------------------------- // ImageLoad.java import java.net.URL; import java.awt.*; class ImageLoad extends Frame { private Image im; static String URL_name; static public void main(String args[]) { URL_name = args[0]; ImageLoad app = new ImageLoad(); app.reshape(100, 100, 320, 430); app.show(); } ImageLoad() { super("Image Test"); URL file = null; try { file = new URL( URL_name ); } catch(Exception e) { System.out.println( e ); System.exit(0); } im = Toolkit.getDefaultToolkit().getImage( file ); } public void paint(Graphics g) { g.drawImage( im, 0, 0, this ); } } >How-To-Repeat: Compile and run the ImageLoad program given in the full description. Try to load an image from server running Apache 1.1.3 vs. one running Apache 1.2b7 >Fix: No, I can't be certain it's not a Java problem, only that the Java program given works for 1.1.3, but not for 1.2b >Audit-Trail: >Unformatted: