OpenCV-wasm-browser, removed external dependencies

This commit is contained in:
Felix Kaspar
2023-10-24 19:03:43 +02:00
parent 9eb3ff4bb3
commit 50a1bd8082
11 changed files with 10274 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
export async function removeBlankPages(snapshot, whiteThreashold, PDFJS, OpenCV) {
export async function removeBlankPages(snapshot, whiteThreashold, PDFJS, OpenCV, PDFLib) {
const pdfDoc = await PDFJS.getDocument(snapshot).promise;
const emptyPages = [];
for (let i = 1; i <= pdfDoc.numPages; i++) {
const page = await pdfDoc.getPage(i);
console.log("Checking images");
if(!await hasText(page)) {
console.log("Found text on Page, page is not empty");