X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fconvert.c;h=75c70804df7b7d4632e9ee9967540f873c21d313;hb=c70c2c7701a7777524881f3f88ab2db2851f932a;hp=e262b26c858b0ea0dda3da03a0549933be9d33fd;hpb=ae5d4e36af4f4a5567e1231958179d3a50eb4466;p=ypp-sc-tools.web-live.git diff --git a/pctb/convert.c b/pctb/convert.c index e262b26..75c7080 100644 --- a/pctb/convert.c +++ b/pctb/convert.c @@ -51,6 +51,7 @@ static char *o_screenshot_fn; static int o_single_page, o_quiet; static const char *o_outputmode= "upload"; +const char *o_resolver; FILE *screenshot_file; @@ -77,6 +78,10 @@ static void run_analysis(void) { progress("running recognition..."); analyse(tf); + if (o_single_page && !strcmp(o_outputmode,"upload")) + fatal("Recognition successful, but refusing to upload partial data\n" + " (--single-page specified). Specify an output mode?"); + sysassert( fseek(tf,0,SEEK_SET) == 0); progress_log("processing results (--%s)...", o_outputmode); @@ -110,10 +115,14 @@ int main(int argc, char **argv) { else if (!strcmp(arg,"--analyse-only") || !strcmp(arg,"--same")) o_mode= mode_analyse; + else if (!strcmp(arg,"--everything")) + o_mode= mode_all; else if (!strcmp(arg,"--single-page")) o_single_page= 1; else if (!strcmp(arg,"--quiet")) o_quiet= 1; + else if (!strcmp(arg,"--edit-charset")) + o_resolver= "./yppsc-ocr-resolver"; else if (!strcmp(arg,"--raw-tsv")) o_outputmode= 0; else if (!strcmp(arg,"--upload") ||