Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Release 4.1.0 - unreleased

* DWGReadParser emits the drawing's THUMBNAILIMAGE as a THUMBNAIL embedded
document instead of INLINE (TIKA-4853).

* EpubParser emits the cover image named by the OPF (the EPUB 3
cover-image manifest property, or the EPUB 2 cover meta) as a THUMBNAIL
embedded document (TIKA-4852).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ private void parseThumbnail(JsonParser jsonParser, XHTMLContentHandler xhtml,
EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(context);
Metadata embeddedMetadata = new Metadata();
embeddedMetadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, "thumbnail");
// The drawing's preview image, not a picture placed in the drawing
embeddedMetadata.set(TikaCoreProperties.EMBEDDED_RESOURCE_TYPE,
TikaCoreProperties.EmbeddedResourceType.INLINE.toString());
TikaCoreProperties.EmbeddedResourceType.THUMBNAIL.toString());
if (!embeddedDocumentExtractor.shouldParseEmbedded(embeddedMetadata, context)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,17 @@ public void testDWGReadexe() throws Exception {
assertNotNull(root.get(DWG.APPLICATION_COMMENT));
assertContains("AutoCAD", root.get(DWG.PRODUCT_INFO));

// Thumbnail embedded as INLINE
// the THUMBNAILIMAGE section is the drawing's THUMBNAIL embedded document
Metadata thumb = null;
for (int i = 1; i < metadataList.size(); i++) {
String type = metadataList.get(i).get(TikaCoreProperties.EMBEDDED_RESOURCE_TYPE);
if (TikaCoreProperties.EmbeddedResourceType.INLINE.name().equals(type)) {
if (TikaCoreProperties.EmbeddedResourceType.THUMBNAIL.name().equals(type)) {
thumb = metadataList.get(i);
break;
}
}
assertNotNull(thumb, "Expected an INLINE thumbnail attachment");
assertNotNull(thumb, "Expected a THUMBNAIL embedded document");
assertEquals("thumbnail", thumb.get(TikaCoreProperties.RESOURCE_NAME_KEY));
}

@Test
Expand Down