Initial addition of gocr.

This commit is contained in:
Scott McCreary
2011-06-03 20:32:30 +00:00
parent 51e6feebba
commit 9e46bf3b4a
2 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
DESCRIPTION="An OCR (Octical Character Recognition) reader"
HOMEPAGE="http://jocr.sofrceforge.net"
SRC_URI="http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-0.49.tar.gz"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
CHECKSUM_MD5="4e527bc4bdd97c2be15fdd818857507f"
BUILD {
cd gocr-0.49
libtoolize --force --copy --install
aclocal
autoconf
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--libdir=`finddir B_COMMON_LIB_DIRECTORY` \
--bindir=`finddir B_COMMON_BIN_DIRECTORY`
make
}
INSTALL {
cd gocr-0.49
make install DESTDIR=${DESTDIR}
}
LICENSE="GNU GPL v2"
COPYRIGHT="2000-2010 Joerg Schulenburg"

View File

@@ -0,0 +1,58 @@
diff -urN gocr-0.49-orig/configure.in gocr-0.49/configure.in
--- gocr-0.49-orig/configure.in 2010-08-04 12:33:10.000000000 +0000
+++ gocr-0.49/configure.in 2011-06-03 13:04:26.985137152 +0000
@@ -41,8 +41,8 @@
# netpbm-9 : libpnm + pnm.h (+ p[bgp]m.h)
# pnm_readpaminit (netpbm-10)
# pnm_readpnminit (netpbm-9,10)
-# ToDo: how to check that -lm is needed?
-LDFLAGS="-lm $LDFLAGS"
+AC_CHECK_LIBM
+LDFLAGS="$LIBM $LDFLAGS"
AC_SEARCH_LIBS(pnm_readpnminit,[netpbm pnm],[check_netpbm_h="pam.h pnm.h"],
[ echo " * * * try option --with-netpbm=PATH"])
fi
diff -urN gocr-0.49-orig/src/barcode.c gocr-0.49/src/barcode.c
--- gocr-0.49-orig/src/barcode.c 2010-08-04 12:03:59.000000000 +0000
+++ gocr-0.49/src/barcode.c 2011-06-03 13:05:00.909115392 +0000
@@ -999,8 +999,10 @@
/* j is the num of bars found above, some inner bars are not counted */
/* ToDo: better iterative add next nearest bars from sorted list near bars? */
{
- int row, col;
+ int row, col, nc, nr, dm_d;
+ int cpos=0;
char *dm_bitmap=NULL;
+ char *code=0;
// store pattern without finder pattern into dm_bitmap
dm_bitmap=(char *)malloc(4*(bx1-regx)*(by1-regy));
@@ -1016,6 +1018,7 @@
/* transport the info to the gocr-output (development) */
if (JOB->cfg.verbose) {
+
fprintf(stderr,"\n# ");
for (col=0;col<2*bx1;col++)
if (col<=8) fprintf(stderr," %1d",col); else
@@ -1048,7 +1051,6 @@
}
}
- char *code=0; int cpos=0;
box2->c=PICTURE; /* BARCODE */
code=NULL;
code=(char *)malloc(6*4*bx1*by1/8+128); /* maxlen: &#%3d; = 6 */
@@ -1070,9 +1072,10 @@
/* ToDo: decode and print/store barcode bars=j */
x = +0; // col += 2
y = +4; // row -= 2
- int nc=2*(bx1-regx), nr=2*(by1-regy),
+ nc=2*(bx1-regx);
+ nr=2*(by1-regy);
// dm_mode=0, // ECC200-mode: 0=ASCII+digitpair, 230=C40
- dm_d=+1; // direction right/down
+ dm_d=+1; // direction right/down
for (j=0;j<(bx1-regx)*(by1-regy)/2;j++) { // each byte
int dm_byte=0;
const int *pp; /* pointer to (const int) */