Class ImageMetadataExtractor


  • public class ImageMetadataExtractor
    extends java.lang.Object
    Uses the Metadata Extractor library to read EXIF and IPTC image metadata and map to Tika fields.

    As of 2.4.0 the library supports jpeg and tiff. As of 2.8.0 the library supports webp.

    • Constructor Detail

      • ImageMetadataExtractor

        public ImageMetadataExtractor​(Metadata metadata)
        Parameters:
        metadata - to extract to, using default directory handlers
      • ImageMetadataExtractor

        public ImageMetadataExtractor​(Metadata metadata,
                                      org.apache.tika.parser.image.ImageMetadataExtractor.DirectoryHandler... handlers)
        Parameters:
        metadata - to extract to
        handlers - handlers in order, note that handlers may override values from earlier handlers
    • Method Detail

      • parseJpeg

        public void parseJpeg​(java.io.File file)
                       throws java.io.IOException,
                              org.xml.sax.SAXException,
                              TikaException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        TikaException
      • parseTiff

        public void parseTiff​(java.io.File file)
                       throws java.io.IOException,
                              org.xml.sax.SAXException,
                              TikaException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        TikaException
      • parseWebP

        public void parseWebP​(java.io.File file)
                       throws java.io.IOException,
                              TikaException
        Throws:
        java.io.IOException
        TikaException
      • parseRawExif

        public void parseRawExif​(java.io.InputStream stream,
                                 int length,
                                 boolean needsExifHeader)
                          throws java.io.IOException,
                                 org.xml.sax.SAXException,
                                 TikaException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        TikaException
      • parseRawExif

        public void parseRawExif​(byte[] exifData)
                          throws java.io.IOException,
                                 org.xml.sax.SAXException,
                                 TikaException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        TikaException
      • parseRawXMP

        public void parseRawXMP​(byte[] xmpData)
                         throws java.io.IOException,
                                org.xml.sax.SAXException,
                                TikaException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        TikaException