Search in sources :

Example 1 with ImageMetadataExtractor

use of org.apache.tika.parser.image.ImageMetadataExtractor in project tika by apache.

the class JpegParser method parse.

public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException {
    TemporaryResources tmp = new TemporaryResources();
    try {
        TikaInputStream tis = TikaInputStream.get(stream, tmp);
        new ImageMetadataExtractor(metadata).parseJpeg(tis.getFile());
        new JempboxExtractor(metadata).parse(tis);
    } finally {
        tmp.dispose();
    }
    XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
    xhtml.startDocument();
    xhtml.endDocument();
}
Also used : JempboxExtractor(org.apache.tika.parser.image.xmp.JempboxExtractor) ImageMetadataExtractor(org.apache.tika.parser.image.ImageMetadataExtractor) TemporaryResources(org.apache.tika.io.TemporaryResources) TikaInputStream(org.apache.tika.io.TikaInputStream) XHTMLContentHandler(org.apache.tika.sax.XHTMLContentHandler)

Aggregations

TemporaryResources (org.apache.tika.io.TemporaryResources)1 TikaInputStream (org.apache.tika.io.TikaInputStream)1 ImageMetadataExtractor (org.apache.tika.parser.image.ImageMetadataExtractor)1 JempboxExtractor (org.apache.tika.parser.image.xmp.JempboxExtractor)1 XHTMLContentHandler (org.apache.tika.sax.XHTMLContentHandler)1