dschmidt commented on PR #3115: URL: https://github.com/apache/tika/pull/3115#issuecomment-5510771958
Thank you, and all of it is in, pushed just now. On 1., I agree, and I did not add the video requirement. The recursion is closed at its source instead: the branch below an emitted trailer is not searched for a trailer of its own. A PDF behind an image is still emitted, an image behind an image too, but it cannot chain. The new test builds the nesting your bot measured and asserts two documents where it got three. Worth its own ticket, maybe: what made this reachable at all is that `ParseRecord.maxEmbeddedDepth` defaults to -1, so `/tika`, tika-app and the facade have no depth guard, only the `RecursiveParserWrapper` path does. Our chain is closed now, but any parser that emits something derived from its own input has the same shape. On 2., the reason for preferring the declaration is that detection cannot tell these apart: an MP4 with the `isom` brand types as `video/quicktime` (that is TIKA-3646), so the extension from detection would be `.mov` on a file whose container says `video/mp4`, and MicroVideo declares no type at all, where detection would guess one. So the declaration still wins, but only within the same top level type. Where the two disagree about the kind of file it is, as with your text trailer, the bytes win and `RESOURCE_NAME_EXTENSION_INFERRED` is set, since that is the case the property describes. On 3., `Files.size`, the detection and the region stream are inside the guard now: locating the trailer is one step that yields nothing rather than throwing, and so is opening it. On the hygiene list: the declared `Item:Mime` stays a string and is only looked up for an extension through `EmbeddedDocumentUtil`, so neither `MediaType.parse` nor `MimeTypes.forName` sees it. `MediaType.parse` on main still caches into `SIMPLE_TYPES`, capped at 10000, and `MimeTypes.forName` still registers what it does not know, which is TIKA-4826. CHANGES.txt now says "not recognized", the embedded parse writes its own div like EMFParser and RawTiffParser, and the tests read the declared length from the fixture. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
