chiark / gitweb /
Do not run ocr resolver by default.
[ypp-sc-tools.db-test.git] / pctb / ocr.c
index 6a91935769ecfc7da0e70681ea80db627c49327e..78542398abe3edcfdbc2078db667a1d135d01d01 100644 (file)
@@ -228,6 +228,11 @@ static void callout_unknown(OcrReader *rd, int w, Pixcol cols[],
   const char *p;
   char cb;
   Pixcol pv;
   const char *p;
   char cb;
   Pixcol pv;
+
+  if (!o_resolver)
+    fatal("OCR failed - unrecognised characters or ligatures.\n"
+         "Character set database needs to be updated or augmented.\n"
+         "See README.charset.\n");
   
   if (!resolver) {
     sysassert(! pipe(jobpipe) );
   
   if (!resolver) {
     sysassert(! pipe(jobpipe) );
@@ -241,7 +246,7 @@ static void callout_unknown(OcrReader *rd, int w, Pixcol cols[],
       /* we know donepipe[1] is >= 4 and we have dealt with all the others
        * so we aren't in any danger of overwriting some other fd 4: */
       sysassert( dup2(donepipe[1],4) ==4 );
       /* we know donepipe[1] is >= 4 and we have dealt with all the others
        * so we aren't in any danger of overwriting some other fd 4: */
       sysassert( dup2(donepipe[1],4) ==4 );
-      execlp("./yppsc-ocr-resolver", "yppsc-ocr-resolver",
+      execlp(o_resolver, o_resolver,
             DEBUGP(callout) ? "--debug" : "--noop-arg",
             "--automatic-1",
             (char*)0);
             DEBUGP(callout) ? "--debug" : "--noop-arg",
             "--automatic-1",
             (char*)0);