harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Irlyanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4222) [classlib][imageio] ImageIO.read works incorrect
Date Mon, 18 Jun 2007 16:06:27 GMT
[classlib][imageio] ImageIO.read works incorrect
------------------------------------------------

                 Key: HARMONY-4222
                 URL: https://issues.apache.org/jira/browse/HARMONY-4222
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Dmitry Irlyanov
         Attachments: H4222-ImageIOTest.patch

If the ImageIOTest complete with 2 additional specified image formats to read the test fails
both on ibm j9 and drlvm:

package javax.imageio;

import java.net.URL;
import java.util.LinkedList;
import java.util.List;

import junit.framework.TestCase;

public class ImageIOTest extends TestCase {

    public void testReadURL() throws Exception {
        // Regression for HARMONY-3135
        for (URL url : listImages()) {
            assertNotNull("Failed to load image from URL " + url,
                    ImageIO.read(url));
            assertFalse("The current thread has been interrupted! URL: " + url, //$NON-NLS-1$
                    Thread.currentThread().isInterrupted());
        }
    }

    protected List<URL> listImages() {
        final String imgPath = "/resources/images/utest."; //$NON-NLS-1$
        final Class<? extends ImageIOTest> c = getClass();
        final List<URL> img = new LinkedList<URL>();

        img.add(c.getResource(imgPath + "jpg")); //$NON-NLS-1$
        img.add(c.getResource(imgPath + "png")); //$NON-NLS-1$
	img.add(c.getResource(imgPath + "gif")); //$NON-NLS-1$
	img.add(c.getResource(imgPath + "bmp")); //$NON-NLS-1$
        return img;
    }
}

on Harmony readImage method cannot read gif and bmp formats:

Failed to load image from URL file:/C:/workspace/Harmony/trunk/working_classlib/modules/imageio/bin/test/resources/images/utest.gif

junit.framework.AssertionFailedError: Failed to load image from URL file:/modules/imageio/bin/test/resources/images/utest.gif
at javax.imageio.ImageIOTest.testReadURL(ImageIOTest.java:31) at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)


on ibm j9 the readImage throws Decompression Error:

java.lang.RuntimeException: Decompression Error at org.apache.harmony.awt.gl.image.PngDecoder.decode(Native
Method) at org.apache.harmony.awt.gl.image.PngDecoder.decodeImage(PngDecoder.java:110) at
org.apache.harmony.awt.gl.image.DecodingImageSource.load(DecodingImageSource.java:252) at
org.apache.harmony.x.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:84) at org.apache.harmony.x.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:93)
at javax.imageio.ImageIO.read(ImageIO.java:249) at javax.imageio.ImageIO.read(ImageIO.java:222)
at javax.imageio.ImageIO.read(ImageIO.java:231) at javax.imageio.ImageIOTest.testReadURL(ImageIOTest.java:32)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message