chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP yppsc-parsedb-updatereceiver; can convert pixmap to email
[ypp-sc-tools.db-live.git]
/
pctb
/
convert.c
diff --git
a/pctb/convert.c
b/pctb/convert.c
index eb7536d6fac4bcc3014f2b7c35880602febc3820..dd7f5d1b426dc32d5315ab37cb11793535f7c526 100644
(file)
--- 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";
static int o_single_page, o_quiet;
static const char *o_outputmode= "upload";
+const char *o_resolver;
FILE *screenshot_file;
FILE *screenshot_file;
@@
-77,6
+78,10
@@
static void run_analysis(void) {
progress("running recognition...");
analyse(tf);
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);
sysassert( fseek(tf,0,SEEK_SET) == 0);
progress_log("processing results (--%s)...", o_outputmode);
@@
-116,6
+121,8
@@
int main(int argc, char **argv) {
o_single_page= 1;
else if (!strcmp(arg,"--quiet"))
o_quiet= 1;
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") ||
else if (!strcmp(arg,"--raw-tsv"))
o_outputmode= 0;
else if (!strcmp(arg,"--upload") ||
@@
-159,6
+166,7
@@
int main(int argc, char **argv) {
else read_screenshots();
}
if (o_mode & mf_analyse) {
else read_screenshots();
}
if (o_mode & mf_analyse) {
+ find_islandname();
if (o_outputmode)
run_analysis();
else
if (o_outputmode)
run_analysis();
else
@@
-251,19
+259,6
@@
void sysassert_fail(const char *file, int line, const char *what) {
_exit(16);
}
_exit(16);
}
-void *mmalloc(size_t sz) {
- void *r;
- if (!sz) return 0;
- sysassert( r= malloc(sz) );
- return r;
-}
-void *mrealloc(void *p, size_t sz) {
- assert(sz);
- void *r;
- sysassert( r= realloc(p,sz) );
- return r;
-}
-
void waitpid_check_exitstatus(pid_t pid, const char *what) {
pid_t got;
int st;
void waitpid_check_exitstatus(pid_t pid, const char *what) {
pid_t got;
int st;