diff options
author | Jason Crain <jason@aquaticape.us> | 2016-03-28 21:36:52 -0500 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2016-04-02 12:31:36 +0200 |
commit | af332349d7a5e3737ea53608cda2f1cad6159108 (patch) | |
tree | 538c6884b4b68e335160d5a45ca6cafd6a700393 | |
parent | db87dc7fa28537f7532328c278c05d8b60f90d6f (diff) |
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
-rw-r--r-- | utils/pdftocairo.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc index 47783e8b..83eeba04 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; |