Java Code Examples for javax.imageio.spi.ImageReaderSpi#getExtraStreamMetadataFormatNames()
The following examples show how to use
javax.imageio.spi.ImageReaderSpi#getExtraStreamMetadataFormatNames() .
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 |
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: RegisteredFormatsTest.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
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 3
Source File: RegisteredFormatsTest.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
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 4
Source File: MetadataFormatPrinter.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 5
Source File: RegisteredFormatsTest.java From hottub with GNU General Public License v2.0 | 4 votes |
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: MetadataFormatPrinter.java From hottub with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 7
Source File: MetadataFormatPrinter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 8
Source File: RegisteredFormatsTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
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 jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
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: MetadataFormatPrinter.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 11
Source File: RegisteredFormatsTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
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 openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
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: MetadataFormatPrinter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 14
Source File: MetadataFormatPrinter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 15
Source File: MetadataFormatPrinter.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 16
Source File: RegisteredFormatsTest.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
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: MetadataFormatPrinter.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 18
Source File: RegisteredFormatsTest.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
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 19
Source File: MetadataFormatPrinter.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) { IIOMetadataFormat format = null; if (args.length == 0 || args[0].equals("javax_imageio_1.0")) { format = IIOMetadataFormatImpl.getStandardFormatInstance(); } else { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator iter = registry.getServiceProviders(ImageReaderSpi.class, false); while (iter.hasNext()) { ImageReaderSpi spi = (ImageReaderSpi)iter.next(); if (args[0].equals (spi.getNativeStreamMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } String[] extraStreamFormatNames = spi.getExtraStreamMetadataFormatNames(); if (extraStreamFormatNames != null && Arrays.asList(extraStreamFormatNames). contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra stream format"); format = spi.getStreamMetadataFormat(args[0]); break; } if (args[0].equals (spi.getNativeImageMetadataFormatName())) { System.out.print(spi.getDescription(null)); System.out.println(": native image format"); format = spi.getImageMetadataFormat(args[0]); break; } String[] extraImageFormatNames = spi.getExtraImageMetadataFormatNames(); if (extraImageFormatNames != null && Arrays.asList(extraImageFormatNames).contains(args[0])) { System.out.print(spi.getDescription(null)); System.out.println(": extra image format"); format = spi.getImageMetadataFormat(args[0]); break; } } } if (format == null) { System.err.println("Unknown format: " + args[0]); System.exit(0); } MetadataFormatPrinter printer = new MetadataFormatPrinter(System.out); printer.print(format); }
Example 20
Source File: RegisteredFormatsTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
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."); } } }