From d78b2cbdbc70b2a1d5a6ed0ce39a30851d9c3bc9 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Thu, 26 May 2016 08:19:34 +0200 Subject: [PATCH] Fix bug where horizontal and vertical borders where switched when page size was also given. Thanks Erik./a.out| sox -c 1 -e unsigned-integer -r 8000 -t u8 - -d --buffer 32 Closes #30 --- src/img2pdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 4fa142b..4415bd7 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -816,11 +816,11 @@ def get_layout_fun(pagesize, imgsize, border, fit, auto_orient): pagewidth, pageheight = pagesize[0], pagesize[1] newborder = border if pagewidth is not None: - fitwidth = pagewidth-2*newborder[0] + fitwidth = pagewidth-2*newborder[1] else: fitwidth = None if pageheight is not None: - fitheight = pageheight-2*newborder[1] + fitheight = pageheight-2*newborder[0] else: fitheight = None if fit in [FitMode.fill, FitMode.enlarge] and \