Package org.apache.tika.parser.image
Class ImageMetadataExtractor
- java.lang.Object
- 
- org.apache.tika.parser.image.ImageMetadataExtractor
 
- 
 public class ImageMetadataExtractor extends 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 SummaryConstructors Constructor Description ImageMetadataExtractor(Metadata metadata)ImageMetadataExtractor(Metadata metadata, org.apache.tika.parser.image.ImageMetadataExtractor.DirectoryHandler... handlers)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidhandle(com.drew.metadata.Metadata metadataExtractor)Copies extracted tags to tika metadata using registered handlers.protected voidhandle(Iterator<com.drew.metadata.Directory> directories)Copies extracted tags to tika metadata using registered handlers.voidparseHeif(InputStream is)voidparseJpeg(File file)voidparseRawExif(byte[] exifData)voidparseRawExif(InputStream stream, int length, boolean needsExifHeader)voidparseRawXMP(byte[] xmpData)voidparseTiff(File file)voidparseWebP(File file)
 
- 
- 
- 
Constructor Detail- 
ImageMetadataExtractorpublic ImageMetadataExtractor(Metadata metadata) - Parameters:
- metadata- to extract to, using default directory handlers
 
 - 
ImageMetadataExtractorpublic 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- 
parseJpegpublic void parseJpeg(File file) throws IOException, SAXException, TikaException - Throws:
- IOException
- SAXException
- TikaException
 
 - 
parseTiffpublic void parseTiff(File file) throws IOException, SAXException, TikaException - Throws:
- IOException
- SAXException
- TikaException
 
 - 
parseWebPpublic void parseWebP(File file) throws IOException, TikaException - Throws:
- IOException
- TikaException
 
 - 
parseHeifpublic void parseHeif(InputStream is) throws IOException, TikaException - Throws:
- IOException
- TikaException
 
 - 
parseRawExifpublic void parseRawExif(InputStream stream, int length, boolean needsExifHeader) throws IOException, SAXException, TikaException - Throws:
- IOException
- SAXException
- TikaException
 
 - 
parseRawExifpublic void parseRawExif(byte[] exifData) throws IOException, SAXException, TikaException- Throws:
- IOException
- SAXException
- TikaException
 
 - 
parseRawXMPpublic void parseRawXMP(byte[] xmpData) throws IOException, SAXException, TikaException- Throws:
- IOException
- SAXException
- TikaException
 
 - 
handleprotected void handle(com.drew.metadata.Metadata metadataExtractor) throws com.drew.metadata.MetadataExceptionCopies extracted tags to tika metadata using registered handlers.- Parameters:
- metadataExtractor- Tag directories from a Metadata Extractor "reader"
- Throws:
- com.drew.metadata.MetadataException- This method does not handle exceptions from Metadata Extractor
 
 - 
handleprotected void handle(Iterator<com.drew.metadata.Directory> directories) throws com.drew.metadata.MetadataException Copies extracted tags to tika metadata using registered handlers.- Parameters:
- directories- Metadata Extractor- Directoryinstances.
- Throws:
- com.drew.metadata.MetadataException- This method does not handle exceptions from Metadata Extractor
 
 
- 
 
-