From dd99124bbe2572d8f2584eb41d3688610dc488d4 Mon Sep 17 00:00:00 2001 From: Balearica Date: Mon, 26 Aug 2024 17:13:07 -0700 Subject: [PATCH] Fixed bug where PDF resources would be loaded for image files --- js/import/import.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/import/import.js b/js/import/import.js index 0868bdf..696015f 100644 --- a/js/import/import.js +++ b/js/import/import.js @@ -442,8 +442,10 @@ export async function importFiles(files, options = {}) { opt.enableOpt = await runFontOptimization(ocrAll.active); } }); - } else if (extractPDFTextNative || extractPDFTextOCR) { - await extractInternalPDFText({ setActive: true, extractPDFTextNative, extractPDFTextOCR, extractPDFTextImage }); + } else if (inputData.pdfMode && (extractPDFTextNative || extractPDFTextOCR)) { + await extractInternalPDFText({ + setActive: true, extractPDFTextNative, extractPDFTextOCR, extractPDFTextImage, + }); } }