< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 196,205 **** --- 196,206 ---- public PNGImageReader(ImageReaderSpi originatingProvider) { super(originatingProvider); } + @Override public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata) { super.setInput(input, seekForwardOnly, ignoreMetadata); this.stream = (ImageInputStream)input; // Always works
*** 1518,1527 **** --- 1519,1529 ---- inf.end(); } } } + @Override public int getNumImages(boolean allowSearch) throws IIOException { if (stream == null) { throw new IllegalStateException("No input source set!"); } if (seekForwardOnly && allowSearch) {
*** 1529,1558 **** --- 1531,1563 ---- ("seekForwardOnly and allowSearch can't both be true!"); } return 1; } + @Override public int getWidth(int imageIndex) throws IIOException { if (imageIndex != 0) { throw new IndexOutOfBoundsException("imageIndex != 0!"); } readHeader(); return metadata.IHDR_width; } + @Override public int getHeight(int imageIndex) throws IIOException { if (imageIndex != 0) { throw new IndexOutOfBoundsException("imageIndex != 0!"); } readHeader(); return metadata.IHDR_height; } + @Override public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IIOException { if (imageIndex != 0) { throw new IndexOutOfBoundsException("imageIndex != 0!");
*** 1783,1792 **** --- 1788,1798 ---- * at the last position of this list. * * After this changes we should override getRawImageType() * to return last element of image types list. */ + @Override public ImageTypeSpecifier getRawImageType(int imageIndex) throws IOException { Iterator<ImageTypeSpecifier> types = getImageTypes(imageIndex); ImageTypeSpecifier raw = null;
*** 1794,1820 **** --- 1800,1830 ---- raw = types.next(); } while (types.hasNext()); return raw; } + @Override public ImageReadParam getDefaultReadParam() { return new ImageReadParam(); } + @Override public IIOMetadata getStreamMetadata() throws IIOException { return null; } + @Override public IIOMetadata getImageMetadata(int imageIndex) throws IIOException { if (imageIndex != 0) { throw new IndexOutOfBoundsException("imageIndex != 0!"); } readMetadata(); return metadata; } + @Override public BufferedImage read(int imageIndex, ImageReadParam param) throws IIOException { if (imageIndex != 0) { throw new IndexOutOfBoundsException("imageIndex != 0!"); }
*** 1830,1839 **** --- 1840,1850 ---- throw new IIOException("Caught exception during read: ", e); } return theImage; } + @Override public void reset() { super.reset(); resetStreamSettings(); }
< prev index next >