From 0cac1b13ee7a7bff01dbdd67489e23fa53b4f3f6 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sat, 25 Feb 2012 20:02:22 +1030 Subject: [PATCH] pdftoppm: maintain correct aspect ratio when only one of -scale-to-[xy] is specified --- utils/pdftoppm.cc | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc index 222c89b..c2865dd 100644 --- a/utils/pdftoppm.cc +++ b/utils/pdftoppm.cc @@ -391,9 +391,13 @@ int main(int argc, char *argv[]) { } else { if (x_scaleTo != 0) { x_resolution = (72.0 * x_scaleTo) / pg_w; + if (y_scaleTo == 0) + y_resolution = x_resolution; } if (y_scaleTo != 0) { y_resolution = (72.0 * y_scaleTo) / pg_h; + if (x_scaleTo == 0) + x_resolution = y_resolution; } } pg_w = pg_w * (x_resolution / 72.0); -- 1.7.5.4