diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-12-28 19:01:30 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-12-28 19:01:30 +0000 |
commit | be7016f7f44273f44b6d15de2ac1daeec1be4f48 (patch) | |
tree | 95db6e2e97760294c92f8bf056c076d6535ae103 /converter | |
parent | 6e21c135e5c5a72b5a58e0dd24b3676780db65ae (diff) | |
download | netpbm-mirror-be7016f7f44273f44b6d15de2ac1daeec1be4f48.tar.gz netpbm-mirror-be7016f7f44273f44b6d15de2ac1daeec1be4f48.tar.xz netpbm-mirror-be7016f7f44273f44b6d15de2ac1daeec1be4f48.zip |
Fix wrong orientation when both -xsize and -ysize specified
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2085 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/pstopnm.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/converter/other/pstopnm.c b/converter/other/pstopnm.c index c0d6a4ee..d867b37b 100644 --- a/converter/other/pstopnm.c +++ b/converter/other/pstopnm.c @@ -548,20 +548,20 @@ computeOrientation(struct CmdlineInfo const cmdline, */ imageWidXel = imageWidPt; imageHgtXel = imageHgtPt; + } - if (imageHgtXel >= imageWidXel && cmdline.ymax >= cmdline.xmax) { - /* Both image and page are higher than wide, so no rotation */ - retval = PORTRAIT; - } else if (imageHgtXel < imageWidXel && - cmdline.ymax < cmdline.xmax) { - /* Both image and page are wider than high, so no rotation */ - retval = PORTRAIT; - } else { - /* Image and pixel have opposite aspect ratios, so rotate - for best fit. - */ - retval = LANDSCAPE; - } + if (imageHgtXel >= imageWidXel && cmdline.ymax >= cmdline.xmax) { + /* Both image and page are higher than wide, so no rotation */ + retval = PORTRAIT; + } else if (imageHgtXel < imageWidXel && + cmdline.ymax < cmdline.xmax) { + /* Both image and page are wider than high, so no rotation */ + retval = PORTRAIT; + } else { + /* Image and pixel have opposite aspect ratios, so rotate + for best fit. + */ + retval = LANDSCAPE; } } return retval; |