import java.io.*; import java.util.*; import javax.imageio.*; import javax.imageio.stream.*; import javax.imageio.metadata.*; public class JPEGMetadataTest { public static void main(String[] args) { if (args.length == 0) { System.out.println("Usage: java Test "); System.exit(0); } try { File f = new File(args[0]); ImageInputStream ios = ImageIO.createImageInputStream(f); Iterator readers = ImageIO.getImageReaders(ios); if (readers.hasNext()) { ImageReader reader = (ImageReader) readers.next(); reader.setInput(ios, true); IIOMetadata metaData = reader.getImageMetadata(0); } System.out.println("That's it. Thanks for your attention"); } catch (IOException ioe) { ioe.printStackTrace(); } } }