From: Bastian Dehn Date: Sat, 4 Apr 2026 07:39:27 +0000 (+0200) Subject: add ocr script X-Git-Tag: v1.1.4^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=ab4b22f1481eed37a68f4997612ddfd87d54ecec;p=scantopdf.git add ocr script --- diff --git a/Makefile b/Makefile index 9221bc6..7462f7f 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ test: $(BUILDDIR)/parts/scanbasic.sh \ build: $(PACKAGEDIR)/$(BINDIR)/scantopdf \ $(PACKAGEDIR)/$(BINDIR)/scantopdfgray \ - $(PACKAGEDIR)/$(BINDIR)/scantopdfbw + $(PACKAGEDIR)/$(BINDIR)/scantopdfbw \ + $(PACKAGEDIR)/$(BINDIR)/addocr package: $(BUILDDIR)/$(PACKAGENAME).deb @@ -52,8 +53,8 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdf: \ mkdir -p $(@D) ./tools/includer $(SRCDIR)/scantopdf \ - | sed "s/@VERSION@/$(VERSION)/" \ - > $(PACKAGEDIR)/$(BINDIR)/scantopdf + | sed "s/@VERSION@/$(VERSION)/" \ + > $(PACKAGEDIR)/$(BINDIR)/scantopdf chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdf $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \ @@ -62,8 +63,8 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \ mkdir -p $(@D) ./tools/includer $(SRCDIR)/scantopdfgray \ - | sed "s/@VERSION@/$(VERSION)/" \ - > $(PACKAGEDIR)/$(BINDIR)/scantopdfgray + | sed "s/@VERSION@/$(VERSION)/" \ + > $(PACKAGEDIR)/$(BINDIR)/scantopdfgray chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfgray $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \ @@ -72,10 +73,20 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \ mkdir -p $(@D) ./tools/includer $(SRCDIR)/scantopdfgray \ - | sed "s/@VERSION@/$(VERSION)/" \ - > $(PACKAGEDIR)/$(BINDIR)/scantopdfbw + | sed "s/@VERSION@/$(VERSION)/" \ + > $(PACKAGEDIR)/$(BINDIR)/scantopdfbw chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfbw +$(PACKAGEDIR)/$(BINDIR)/addocr: \ + $(SRCDIR)/errlog.sh \ + $(SRCDIR)/addocr.sh + + mkdir -p $(@D) + ./tools/includer $(SRCDIR)/addocr \ + | sed "s/@VERSION@/$(VERSION)/" \ + > $(PACKAGEDIR)/$(BINDIR)/addocr + chmod 755 $(PACKAGEDIR)/$(BINDIR)/addocr + ################################################################################ $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html: \ @@ -98,6 +109,7 @@ $(BUILDDIR)/$(PACKAGENAME).deb: \ $(PACKAGEDIR)/$(BINDIR)/scantopdf \ $(PACKAGEDIR)/$(BINDIR)/scantopdfgray \ $(PACKAGEDIR)/$(BINDIR)/scantopdfbw \ + $(PACKAGEDIR)/$(BINDIR)/addocr \ $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html \ $(PACKAGEDIR)/DEBIAN/control diff --git a/src/addocr b/src/addocr new file mode 100644 index 0000000..c9c562e --- /dev/null +++ b/src/addocr @@ -0,0 +1,23 @@ +#!/bin/bash +#include "errlog.sh" +#include "addocr.sh" + +main() +{ + local file="$1" + + echo "⭐ START: addocr" + + [ -n "$file" ] \ + || errlog "missing file" \ + || return $? + [ -f "$file" ] \ + || errlog "file $file does not exists" \ + || return $? + + addocr "$file" + + echo "✅ SUCCESS: addocr" +} + +main $* \ No newline at end of file