@Test
public void testGIF() throws Exception {

    Metadata metadata = new Metadata();
    metadata.set(Metadata.CONTENT_TYPE, "image/gif");
    try (InputStream stream = getClass().getResourceAsStream("/test-documents/testGIF.gif")) {
        parser.parse(stream, new DefaultHandler(), metadata, new ParseContext());
    }
    assertEquals("75", metadata.get("height"));
    assertEquals("100", metadata.get("width"));
    assertEquals("true", metadata.get("Compression Lossless"));
    assertEquals("Normal", metadata.get("Dimension ImageOrientation"));
    assertEquals("lzw", metadata.get("Compression CompressionTypeName"));
    assertEquals("0", metadata.get("Dimension HorizontalPixelOffset"));
    assertEquals("imageLeftPosition=0, imageTopPosition=0, imageWidth=100, imageHeight=75, interlaceFlag=false", metadata.get("ImageDescriptor"));
    assertEquals("Index", metadata.get("Data SampleFormat"));
    assertEquals("3", metadata.get("Chroma NumChannels"));
    assertEquals("1", metadata.get("Compression NumProgressiveScans"));
    assertEquals("RGB", metadata.get("Chroma ColorSpaceType"));
    assertEquals("Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.", metadata.get("CommentExtensions CommentExtension"));
    assertEquals("value=Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership., encoding=ISO-8859-1, compression=none", metadata.get("Text TextEntry"));
    assertEquals("true", metadata.get("Chroma BlackIsZero"));
    assertEquals("disposalMethod=none, userInputFlag=false, transparentColorFlag=false, delayTime=0, transparentColorIndex=0", metadata.get("GraphicControlExtension"));
    assertEquals("0", metadata.get("Dimension VerticalPixelOffset"));
    assertEquals("image/gif", metadata.get("Content-Type"));
    assertEquals("100", metadata.get(Metadata.IMAGE_WIDTH));
    assertEquals("75", metadata.get(Metadata.IMAGE_LENGTH));
    assertEquals("Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.", metadata.get(TikaCoreProperties.COMMENTS));
}