Search in sources :

Example 1 with ExifReader

use of com.drew.metadata.exif.ExifReader in project tika by apache.

the class ImageMetadataExtractor method parseRawExif.

public void parseRawExif(byte[] exifData) throws IOException, SAXException, TikaException {
    com.drew.metadata.Metadata metadata = new com.drew.metadata.Metadata();
    ExifReader reader = new ExifReader();
    reader.extract(new ByteArrayReader(exifData), metadata, ExifReader.JPEG_SEGMENT_PREAMBLE.length());
    try {
        handle(metadata);
    } catch (MetadataException e) {
        throw new TikaException("Can't process the EXIF Data", e);
    }
}
Also used : ExifReader(com.drew.metadata.exif.ExifReader) TikaException(org.apache.tika.exception.TikaException) Metadata(org.apache.tika.metadata.Metadata) XMPMetadata(org.apache.jempbox.xmp.XMPMetadata) ByteArrayReader(com.drew.lang.ByteArrayReader) MetadataException(com.drew.metadata.MetadataException)

Aggregations

ByteArrayReader (com.drew.lang.ByteArrayReader)1 MetadataException (com.drew.metadata.MetadataException)1 ExifReader (com.drew.metadata.exif.ExifReader)1 XMPMetadata (org.apache.jempbox.xmp.XMPMetadata)1 TikaException (org.apache.tika.exception.TikaException)1 Metadata (org.apache.tika.metadata.Metadata)1