@Test
    void testReadExif() throws IOException, ImagingException {
        final String input = "/images/png/IMAGING-340/image-with-exif.png";
        final String file = PngReadTest.class.getResource(input).getFile();
        final PngImageParser parser = new PngImageParser();

        final PngImageMetadata pngMetadata = (PngImageMetadata) parser.getMetadata(new File(file));

        final TiffImageMetadata exifMetadata = pngMetadata.getExif();
        assertEquals("Glavo",
                exifMetadata.findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_ROOT)
                        .getFieldValue(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION));

        final PngImageMetadata metadata = (PngImageMetadata) parser.getMetadata(new File(file));
        assertTrue(metadata.getTextualInformation().getItems().isEmpty());
        assertEquals("Glavo",
                metadata.getExif()
                        .findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_ROOT)
                        .getFieldValue(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION));
    }
Test reading EXIF from the 'eXIf' chunk in PNG file.

@throws IOException if it fails to read the test image
@throws ImagingException if it fails to read the test image
src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java