Blame SOURCES/tika-1.5-metadata-extractor.patch

aa1005
diff -Nru tika-1.5/tika-parsers/pom.xml tika-1.5.metadata-extractor/tika-parsers/pom.xml
aa1005
--- tika-1.5/tika-parsers/pom.xml	2015-04-22 18:32:55.673585133 +0200
aa1005
+++ tika-1.5.metadata-extractor/tika-parsers/pom.xml	2015-04-22 18:31:18.890503541 +0200
aa1005
@@ -163,7 +163,7 @@
aa1005
     <dependency>
aa1005
        <groupId>com.drewnoakes</groupId>
aa1005
        <artifactId>metadata-extractor</artifactId>
aa1005
-       <version>2.6.2</version>
aa1005
+       <version>2.8.1</version>
aa1005
     </dependency>
aa1005
     <dependency>
aa1005
       <groupId>de.l3s.boilerpipe</groupId>
aa1005
diff -Nru tika-1.5/tika-parsers/src/main/java/org/apache/tika/parser/image/ImageMetadataExtractor.java tika-1.5.metadata-extractor/tika-parsers/src/main/java/org/apache/tika/parser/image/ImageMetadataExtractor.java
aa1005
--- tika-1.5/tika-parsers/src/main/java/org/apache/tika/parser/image/ImageMetadataExtractor.java	2014-02-09 21:36:28.000000000 +0100
aa1005
+++ tika-1.5.metadata-extractor/tika-parsers/src/main/java/org/apache/tika/parser/image/ImageMetadataExtractor.java	2015-04-22 18:28:12.139993992 +0200
aa1005
@@ -37,6 +37,7 @@
aa1005
 import com.drew.imaging.jpeg.JpegMetadataReader;
aa1005
 import com.drew.imaging.jpeg.JpegProcessingException;
aa1005
 import com.drew.imaging.tiff.TiffMetadataReader;
aa1005
+import com.drew.imaging.tiff.TiffProcessingException;
aa1005
 import com.drew.lang.GeoLocation;
aa1005
 import com.drew.lang.Rational;
aa1005
 import com.drew.metadata.Directory;
aa1005
@@ -104,6 +105,8 @@
aa1005
             handle(tiffMetadata);
aa1005
         } catch (MetadataException e) {
aa1005
             throw new TikaException("Can't read TIFF metadata", e);
aa1005
+        } catch (TiffProcessingException e) {
aa1005
+            throw new TikaException("Can't processing TIFF metadata", e);
aa1005
         }
aa1005
     }
aa1005
 
aa1005
@@ -217,12 +220,12 @@
aa1005
             //Exif.Image.ImageWidth                        Short       1  100
aa1005
             //Exif.Image.ImageLength                       Short       1  75
aa1005
             // and the values are found in "Thumbnail Image Width" (and Height) from Metadata Extractor
aa1005
-            set(directory, metadata, ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_WIDTH, Metadata.IMAGE_WIDTH);
aa1005
-            set(directory, metadata, JpegDirectory.TAG_JPEG_IMAGE_WIDTH, Metadata.IMAGE_WIDTH);
aa1005
-            set(directory, metadata, ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_HEIGHT, Metadata.IMAGE_LENGTH);
aa1005
-            set(directory, metadata, JpegDirectory.TAG_JPEG_IMAGE_HEIGHT, Metadata.IMAGE_LENGTH);
aa1005
+            set(directory, metadata, ExifThumbnailDirectory.TAG_IMAGE_WIDTH, Metadata.IMAGE_WIDTH);
aa1005
+            set(directory, metadata, JpegDirectory.TAG_IMAGE_WIDTH, Metadata.IMAGE_WIDTH);
aa1005
+            set(directory, metadata, ExifThumbnailDirectory.TAG_IMAGE_HEIGHT, Metadata.IMAGE_LENGTH);
aa1005
+            set(directory, metadata, JpegDirectory.TAG_IMAGE_HEIGHT, Metadata.IMAGE_LENGTH);
aa1005
             // Bits per sample, two methods of extracting, exif overrides jpeg
aa1005
-            set(directory, metadata, JpegDirectory.TAG_JPEG_DATA_PRECISION, Metadata.BITS_PER_SAMPLE);
aa1005
+            set(directory, metadata, JpegDirectory.TAG_DATA_PRECISION, Metadata.BITS_PER_SAMPLE);
aa1005
             set(directory, metadata, ExifSubIFDDirectory.TAG_BITS_PER_SAMPLE, Metadata.BITS_PER_SAMPLE);
aa1005
             // Straightforward
aa1005
             set(directory, metadata, ExifSubIFDDirectory.TAG_SAMPLES_PER_PIXEL, Metadata.SAMPLES_PER_PIXEL);
aa1005
@@ -242,8 +245,8 @@
aa1005
             return directoryType == JpegCommentDirectory.class;
aa1005
         }
aa1005
         public void handle(Directory directory, Metadata metadata) throws MetadataException {
aa1005
-            if (directory.containsTag(JpegCommentDirectory.TAG_JPEG_COMMENT)) {
aa1005
-                metadata.add(TikaCoreProperties.COMMENTS, directory.getString(JpegCommentDirectory.TAG_JPEG_COMMENT));
aa1005
+            if (directory.containsTag(JpegCommentDirectory.TAG_COMMENT)) {
aa1005
+                metadata.add(TikaCoreProperties.COMMENTS, directory.getString(JpegCommentDirectory.TAG_COMMENT));
aa1005
             }
aa1005
         }
aa1005
     }
aa1005
@@ -362,11 +365,11 @@
aa1005
             if(directory.containsTag(ExifIFD0Directory.TAG_RESOLUTION_UNIT)) {
aa1005
                metadata.set(Metadata.RESOLUTION_UNIT, directory.getDescription(ExifIFD0Directory.TAG_RESOLUTION_UNIT));
aa1005
             }
aa1005
-            if(directory.containsTag(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_WIDTH)) {
aa1005
-                metadata.set(Metadata.IMAGE_WIDTH, directory.getDescription(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_WIDTH));
aa1005
+            if(directory.containsTag(ExifThumbnailDirectory.TAG_IMAGE_WIDTH)) {
aa1005
+                metadata.set(Metadata.IMAGE_WIDTH, directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_WIDTH));
aa1005
             }
aa1005
-            if(directory.containsTag(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_HEIGHT)) {
aa1005
-                metadata.set(Metadata.IMAGE_LENGTH, directory.getDescription(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_HEIGHT));
aa1005
+            if(directory.containsTag(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT)) {
aa1005
+                metadata.set(Metadata.IMAGE_LENGTH, directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT));
aa1005
             }
aa1005
         }
aa1005
         /**