TIKA-4856 presets - #3118
Conversation
|
First draft. @dschmidt wdyt? |
|
My agent was a bit quick to post a response I didn't want him to, sorry about that. Here's my handwritten response: I like this a lot - it feels way more natural than the thumbnails specific config: no allowPerRequestConfig, content resolved worker side, and a path a proxy can filter on. Just one remark for the UnpackSelector discussed in my PR (not because it's part of this, but because it's the other half of the desired functionality): P.S.: I'm happy to provide the maxRenderedPages features in a separate standalone PR (or you incorporate it from my PR, however you like) |
|
Can we filter on type and mime? |
Ah, yeah, why not?! Sounds good :) I don't see when I (or anyone else) would ever want those weird windows vector graphics ... |
|
but I think the thumbnail preset should only contain the THUMBNAIL resource type, not rendering... in my recent work I tried to make sure that renderings of the thumbnail also have the type THUMBNAIL. So we can differentiate it from other renderings |
|
Y, makes sense. Unrelated -- I'm getting uncomfortable with THUMBNAIL vs RENDERING. One should be the thing actually in the document, and the rendering is something derived. I think you added a metadata key to distinguish, but it doesn't sit well. And yet there should be a "USE AS THUMBNAIL" flag for your use case, which I'm sure others have. My 🤖 thinks it is fine, but.... wdyt? |
|
This PR or the THUMBNAIL vs RENDERING situation? THUMBNAIL vs RENDERING: not sure what the right approach here is ... they are two separate dimensions really. Regarding this PR: This is what config would look like? {
"presets": {
"thumbnails": {
"pdf-parser": {
"imageStrategy": "RENDER_PAGES_AT_PAGE_END",
"maxRenderedPages": 1,
"ocr": { "dpi": 96, "imageType": "RGB" }
},
"emf-parser": { "renderImage": true, "renderOnlyEmbeddedResourceTypes": ["THUMBNAIL"] },
"wmf-parser": { "renderImage": true, "renderOnlyEmbeddedResourceTypes": ["THUMBNAIL"] }
},
// no idea for a good name, it should simply disable everything expesnive not needed for the thumbnail
"thumbnails-no-ocr": {
"pdf-parser": {
"imageStrategy": "RENDER_PAGES_AT_PAGE_END",
"maxRenderedPages": 1,
"ocr": { "dpi": 96, "imageType": "RGB", "strategy": "NO_OCR" }
},
"emf-parser": { "renderImage": true, "renderOnlyEmbeddedResourceTypes": ["THUMBNAIL"] },
"wmf-parser": { "renderImage": true, "renderOnlyEmbeddedResourceTypes": ["THUMBNAIL"] },
"tesseract-ocr-parser": { "skipOcr": true }
}
}
}Can we somehow ship this by default? |
|
Y, on a separate ticket we can add defaults. |
Unrelated to this PR specifically. |
|
Sounds good :) |
Thanks for your contribution to Apache Tika! Your help is appreciated!
Before opening the pull request, please verify that
TIKA-XXXX)[TIKA-XXXX] Issue or pull request title)./mvnw clean install(clean testalone cannot resolve the pipes plugin zips)Generated-by: <tool>in the commit message), and consider running the pre-flight in.skills/devs/pr-review/SKILL.md— fix what it finds; don't paste its report heremainbranch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulledmainbranchtika-bom/pom.xml.We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!