utils/pdftoppm.cc |   42 +++++++++++++++---------------------------
 1 file changed, 15 insertions(+), 27 deletions(-)

New commits:
commit fdba9154d9a176759c765180805e608d4959c34e
Author: Adam Reichold <[email protected]>
Date:   Fri Jan 16 19:57:59 2015 +0100

    pdftoppm: parse the flags earlier and only once

diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 7ff5b22..3574595 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -24,7 +24,7 @@
 // Copyright (C) 2010 Jonathan Liu <[email protected]>
 // Copyright (C) 2010 William Bader <[email protected]>
 // Copyright (C) 2011-2013 Thomas Freitag <[email protected]>
-// Copyright (C) 2013 Adam Reichold <[email protected]>
+// Copyright (C) 2013, 2015 Adam Reichold <[email protected]>
 // Copyright (C) 2013 Suzuki Toshiya <[email protected]>
 // Copyright (C) 2015 William Bader <[email protected]>
 //
@@ -93,6 +93,8 @@ static GBool overprint = gFalse;
 static char enableFreeTypeStr[16] = "";
 static char antialiasStr[16] = "";
 static char vectorAntialiasStr[16] = "";
+static GBool fontAntialias = gTrue;
+static GBool vectorAntialias = gTrue;
 static char ownerPassword[33] = "";
 static char userPassword[33] = "";
 static char TiffCompressionStr[16] = "";
@@ -269,20 +271,6 @@ static std::deque<PageJob> pageJobQueue;
 static pthread_mutex_t pageJobMutex = PTHREAD_MUTEX_INITIALIZER;
 
 static void processPageJobs() {
-  GBool fontAntialias = gTrue;
-  GBool vectorAntialias = gTrue;
-
-  if (antialiasStr[0]) {
-    if (!GlobalParams::parseYesNo2(antialiasStr, &fontAntialias)) {
-      fprintf(stderr, "Bad '-aa' value on command line\n");
-    }
-  }
-  if (vectorAntialiasStr[0]) {
-    if (!GlobalParams::parseYesNo2(vectorAntialiasStr, &vectorAntialias)) {
-      fprintf(stderr, "Bad '-aaVector' value on command line\n");
-    }
-  }
-
   while(true) {
     // pop the next job or exit if queue is empty
     pthread_mutex_lock(&pageJobMutex);
@@ -345,8 +333,6 @@ int main(int argc, char *argv[]) {
   int exitCode;
   int pg, pg_num_len;
   double pg_w, pg_h, tmp;
-  GBool fontAntialias = gTrue;
-  GBool vectorAntialias = gTrue;
 
   exitCode = 99;
 
@@ -375,6 +361,17 @@ int main(int argc, char *argv[]) {
   if (argc > 1) fileName = new GooString(argv[1]);
   if (argc == 3) ppmRoot = argv[2];
 
+  if (antialiasStr[0]) {
+    if (!GlobalParams::parseYesNo2(antialiasStr, &fontAntialias)) {
+      fprintf(stderr, "Bad '-aa' value on command line\n");
+    }
+  }
+  if (vectorAntialiasStr[0]) {
+    if (!GlobalParams::parseYesNo2(vectorAntialiasStr, &vectorAntialias)) {
+      fprintf(stderr, "Bad '-aaVector' value on command line\n");
+    }
+  }
+
   // read config file
   globalParams = new GlobalParams();
   if (enableFreeTypeStr[0]) {
@@ -475,16 +472,7 @@ int main(int argc, char *argv[]) {
                                             splashModeRGB8, 4,
                                  gFalse, paperColor, gTrue, thinLineMode);
 
-  if (antialiasStr[0]) {
-    if (!GlobalParams::parseYesNo2(antialiasStr, &fontAntialias)) {
-      fprintf(stderr, "Bad '-aa' value on command line\n");
-    }
-  }
-  if (vectorAntialiasStr[0]) {
-    if (!GlobalParams::parseYesNo2(vectorAntialiasStr, &vectorAntialias)) {
-      fprintf(stderr, "Bad '-aaVector' value on command line\n");
-    }
-  }
+
 
   splashOut->setFontAntialias(fontAntialias);
   splashOut->setVectorAntialias(vectorAntialias);
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to