Java Code Examples for javax.imageio.spi.ImageReaderSpi#getNativeStreamMetadataFormatName()

The following examples show how to use javax.imageio.spi.ImageReaderSpi#getNativeStreamMetadataFormatName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PNGSpiStreamMetadata.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    ImageReaderSpi rspi = new PNGImageReaderSpi();
    if (rspi.getNativeStreamMetadataFormatName() != null) {
        fatal();
    }
    if (rspi.isStandardStreamMetadataFormatSupported() != false) {
        fatal();
    }
    if (rspi.getExtraStreamMetadataFormatNames() != null) {
        fatal();
    }

    ImageWriterSpi wspi = new PNGImageWriterSpi();
    if (wspi.getNativeStreamMetadataFormatName() != null) {
        fatal();
    }
    if (wspi.isStandardStreamMetadataFormatSupported() != false) {
        fatal();
    }
    if (wspi.getExtraStreamMetadataFormatNames() != null) {
        fatal();
    }
}
 
Example 2
Source File: PNGSpiStreamMetadata.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    ImageReaderSpi rspi = new PNGImageReaderSpi();
    if (rspi.getNativeStreamMetadataFormatName() != null) {
        fatal();
    }
    if (rspi.isStandardStreamMetadataFormatSupported() != false) {
        fatal();
    }
    if (rspi.getExtraStreamMetadataFormatNames() != null) {
        fatal();
    }

    ImageWriterSpi wspi = new PNGImageWriterSpi();
    if (wspi.getNativeStreamMetadataFormatName() != null) {
        fatal();
    }
    if (wspi.isStandardStreamMetadataFormatSupported() != false) {
        fatal();
    }
    if (wspi.getExtraStreamMetadataFormatNames() != null) {
        fatal();
    }
}
 
Example 3
Source File: TIFFJPEGCompressor.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public boolean filter(Object provider) {
    ImageReaderSpi readerSPI = (ImageReaderSpi)provider;

    if(readerSPI != null) {
        String streamMetadataName =
            readerSPI.getNativeStreamMetadataFormatName();
        if(streamMetadataName != null) {
            return streamMetadataName.equals(STREAM_METADATA_NAME);
        } else {
            return false;
        }
    }

    return false;
}
 
Example 4
Source File: TIFFJPEGCompressor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public boolean filter(Object provider) {
    ImageReaderSpi readerSPI = (ImageReaderSpi)provider;

    if(readerSPI != null) {
        String streamMetadataName =
            readerSPI.getNativeStreamMetadataFormatName();
        if(streamMetadataName != null) {
            return streamMetadataName.equals(STREAM_METADATA_NAME);
        } else {
            return false;
        }
    }

    return false;
}
 
Example 5
Source File: RegisteredFormatsTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 6
Source File: RegisteredFormatsTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 7
Source File: RegisteredFormatsTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 8
Source File: RegisteredFormatsTest.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 9
Source File: RegisteredFormatsTest.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 10
Source File: RegisteredFormatsTest.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 11
Source File: RegisteredFormatsTest.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 12
Source File: RegisteredFormatsTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 13
Source File: RegisteredFormatsTest.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 14
Source File: RegisteredFormatsTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 15
Source File: RegisteredFormatsTest.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 16
Source File: RegisteredFormatsTest.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
Example 17
Source File: RegisteredFormatsTest.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}