[poppler] utils/pdftocairo.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sat Apr 2 10:36:55 UTC 2016


 utils/pdftocairo.cc |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit af332349d7a5e3737ea53608cda2f1cad6159108
Author: Jason Crain <jason at aquaticape.us>
Date:   Mon Mar 28 21:36:52 2016 -0500

    pdftocairo: Calculate rotation before scaling
    
    Scaling calculation (-scale-to-x and -scale-to-y) is wrong if a page is
    rotated.  Fix by moving scale calculation to after rotation calculation.
    
    bug #94655

diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index 47783e8..83eeba0 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -1112,6 +1112,11 @@ int main(int argc, char *argv[]) {
       }
     }
 
+    if ((doc->getPageRotate(pg) == 90) || (doc->getPageRotate(pg) == 270)) {
+      tmp = pg_w;
+      pg_w = pg_h;
+      pg_h = tmp;
+    }
     if (scaleTo != 0) {
       resolution = (72.0 * scaleTo) / (pg_w > pg_h ? pg_w : pg_h);
       x_resolution = y_resolution = resolution;
@@ -1127,11 +1132,6 @@ int main(int argc, char *argv[]) {
           x_resolution = y_resolution;
       }
     }
-    if ((doc->getPageRotate(pg) == 90) || (doc->getPageRotate(pg) == 270)) {
-      tmp = pg_w;
-      pg_w = pg_h;
-      pg_h = tmp;
-    }
     if (imageFileName) {
       delete imageFileName;
       imageFileName = NULL;


More information about the poppler mailing list