diff options
author | Didier Raboud <odyx@debian.org> | 2012-02-12 16:46:25 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2012-02-12 16:48:17 +0100 |
commit | 78a91f8139e6c5a4e0788dcd84fdb1d750d8e592 (patch) | |
tree | c996d3423963c2c749ae8c45e8f21e81c89fff32 /foomaticrip.c | |
parent | d94f85817be7ea7719b016a50debf8c5437b5877 (diff) | |
parent | c37b83b7f385a7f044db499b9354003c888e91e8 (diff) |
Merge branch 'master' of git://anonscm.debian.org/collab-maint/foomatic-filters
Diffstat (limited to 'foomaticrip.c')
-rw-r--r-- | foomaticrip.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/foomaticrip.c b/foomaticrip.c index e9ae0f7..799a259 100644 --- a/foomaticrip.c +++ b/foomaticrip.c @@ -1054,14 +1054,17 @@ int print_file(const char *filename, int convert) Note that Ghostscript's "pswrite" output device turns text into bitmaps and therefore produces huge PostScript files. In addition, this output device is deprecated. Therefore - we use "ps2write". */ + we use "ps2write". + We give priority to Ghostscript here and use Poppler if + Ghostscript is not available. */ snprintf(pdf2ps_cmd, PATH_MAX, - "%spdftops -level2 -origpagesizes %s - 2>/dev/null || " "gs -q -sstdout=%%stderr -sDEVICE=ps2write -sOutputFile=- " - "-dBATCH -dNOPAUSE -dPARANOIDSAFER -dNOINTERPOLATE %s 2>/dev/null", + "-dBATCH -dNOPAUSE -dPARANOIDSAFER -dNOINTERPOLATE %s 2>/dev/null || " + "%spdftops -level2 -origpagesizes %s - 2>/dev/null", + filename, (spooler == SPOOLER_CUPS ? "PATH=${PATH#*/cups/filter:} " : ""), - filename, filename); + filename); renderer_pid = start_system_process("pdf-to-ps", pdf2ps_cmd, &in, &out); @@ -1188,9 +1191,13 @@ int main(int argc, char** argv) if (arglist_remove_flag(arglist, "--debug")) debug = 1; - if (debug) - logh = fopen(LOG_FILE ".log", "w"); /* insecure, use for debugging only */ - else if (quiet && !verbose) + if (debug) { + int fd = mkstemp (LOG_FILE "-XXXXXX.log"); + if (fd != -1) + logh = fdopen(fd, "w"); + else + logh = stderr; + } else if (quiet && !verbose) logh = NULL; /* Quiet mode, do not log */ else logh = stderr; /* Default: log to stderr */ @@ -1634,11 +1641,6 @@ int main(int argc, char** argv) /* TODO tbd */ } - /* In debug mode save the data supposed to be fed into the - renderer also into a file, reset the file here */ - if (debug) - run_system_process("reset-file", "> " LOG_FILE ".ps"); - filename = strtok_r(filelist->data, " ", &p); while (filename) { _log("\n================================================\n\n" |