mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Update scalafmt to 2.5.1 + scalafmtAll
This commit is contained in:
@ -60,7 +60,7 @@ object Extraction {
|
||||
|
||||
ImageSize.get(data).flatMap {
|
||||
case Some(dim) =>
|
||||
if (dim.product > cfg.ocr.maxImageSize) {
|
||||
if (dim.product > cfg.ocr.maxImageSize)
|
||||
logger.info(
|
||||
s"Image size (${dim.product}) is too large (max ${cfg.ocr.maxImageSize})."
|
||||
) *>
|
||||
@ -71,9 +71,8 @@ object Extraction {
|
||||
)
|
||||
)
|
||||
.pure[F]
|
||||
} else {
|
||||
else
|
||||
doExtract
|
||||
}
|
||||
case None =>
|
||||
logger.info(
|
||||
s"Cannot read image data from ${mt.asString}. Extracting anyways."
|
||||
|
@ -33,8 +33,9 @@ object PdfExtract {
|
||||
|
||||
//maybe better: inspect the pdf and decide whether ocr or not
|
||||
for {
|
||||
pdfboxRes <- logger.debug("Trying to strip text from pdf using pdfbox.") *> PdfboxExtract
|
||||
.get[F](in)
|
||||
pdfboxRes <-
|
||||
logger.debug("Trying to strip text from pdf using pdfbox.") *> PdfboxExtract
|
||||
.get[F](in)
|
||||
res <- pdfboxRes.fold(
|
||||
ex =>
|
||||
logger.info(
|
||||
@ -44,7 +45,9 @@ object PdfExtract {
|
||||
if (str.length >= stripMinLen) str.pure[F].attempt
|
||||
else
|
||||
logger
|
||||
.info(s"Stripped text from PDF is small (${str.length}). Trying with OCR.") *>
|
||||
.info(
|
||||
s"Stripped text from PDF is small (${str.length}). Trying with OCR."
|
||||
) *>
|
||||
runOcr.flatMap(ocrStr => chooseResult(ocrStr, str)).attempt
|
||||
)
|
||||
} yield res
|
||||
|
Reference in New Issue
Block a user