Filter by mime
Some checks failed
CI / Typos (push) Successful in 17s
CI / Build and test (push) Successful in 2m28s
CI / Clippy (push) Failing after 3m59s
CI / Build and test (all features) (push) Successful in 9m40s

This commit is contained in:
2026-03-15 10:20:15 -07:00
parent 32aedb9dc1
commit a2079877fd
30 changed files with 258 additions and 93 deletions

View File

@@ -9,7 +9,7 @@ use std::{
use tracing::trace;
use crate::{
extract::traits::ObjectExtractor,
extract::traits::{ExtractState, ObjectExtractor},
value::{Item, PileValue, SyncReadBridge},
};
@@ -104,6 +104,7 @@ impl PdfTextExtractor {
impl ObjectExtractor for PdfTextExtractor {
async fn field(
&self,
state: &ExtractState,
name: &Label,
args: Option<&str>,
) -> Result<Option<PileValue>, std::io::Error> {
@@ -111,6 +112,10 @@ impl ObjectExtractor for PdfTextExtractor {
return Ok(None);
}
if !state.ignore_mime && self.item.mime().essence_str() != "application/pdf" {
return Ok(None);
}
Ok(self.get_inner().await?.get(name).cloned())
}