mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge pull request #6382 from sleuthkit/revert-6378-extractInlinePDFimages
Revert "Extract inline images from PDF"
This commit is contained in:
commit
bc7a0a71a2
@ -34,7 +34,6 @@ import org.apache.tika.metadata.Metadata;
|
|||||||
import org.apache.tika.parser.AutoDetectParser;
|
import org.apache.tika.parser.AutoDetectParser;
|
||||||
import org.apache.tika.parser.ParseContext;
|
import org.apache.tika.parser.ParseContext;
|
||||||
import org.apache.tika.parser.Parser;
|
import org.apache.tika.parser.Parser;
|
||||||
import org.apache.tika.parser.pdf.PDFParserConfig;
|
|
||||||
import org.apache.tika.sax.BodyContentHandler;
|
import org.apache.tika.sax.BodyContentHandler;
|
||||||
import org.xml.sax.ContentHandler;
|
import org.xml.sax.ContentHandler;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@ -77,17 +76,9 @@ final class PDFAttachmentExtractor {
|
|||||||
ExtractionPreconditions.checkArgument(Files.exists(outputDir),
|
ExtractionPreconditions.checkArgument(Files.exists(outputDir),
|
||||||
String.format("Output directory: %s, does not exist.", outputDir.toString())); //NON-NLS
|
String.format("Output directory: %s, does not exist.", outputDir.toString())); //NON-NLS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ParseContext parseContext = new ParseContext();
|
ParseContext parseContext = new ParseContext();
|
||||||
parseContext.set(Parser.class, parser);
|
parseContext.set(Parser.class, parser);
|
||||||
|
|
||||||
PDFParserConfig pdfConfig = new PDFParserConfig();
|
|
||||||
pdfConfig.setExtractInlineImages(true);
|
|
||||||
pdfConfig.setExtractUniqueInlineImagesOnly(true);
|
|
||||||
|
|
||||||
parseContext.set(PDFParserConfig.class, pdfConfig);
|
|
||||||
|
|
||||||
//Keep track of the attachment files as they are being extracted and written to disk.
|
//Keep track of the attachment files as they are being extracted and written to disk.
|
||||||
NewResourceWatcher watcher = new NewResourceWatcher();
|
NewResourceWatcher watcher = new NewResourceWatcher();
|
||||||
parseContext.set(EmbeddedDocumentExtractor.class, new EmbeddedAttachmentHandler(outputDir, parentID, watcher));
|
parseContext.set(EmbeddedDocumentExtractor.class, new EmbeddedAttachmentHandler(outputDir, parentID, watcher));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user