From 2d2a8a3d71259a905dd2313ddc6297c838bda1c2 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Wed, 22 Jun 2022 10:37:16 +0200 Subject: [PATCH] Fix row calculation to include all pages Previously, if the number of input pages was not a square number, only the next smaller square number of pages were contained in the default output. --- pdfstitch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfstitch b/pdfstitch index a754d0a..3fb8b33 100755 --- a/pdfstitch +++ b/pdfstitch @@ -22,7 +22,7 @@ Getopt::Long::Configure("bundling"); my $usage = < +pdfstitch - Copyright (C) 2017-2022 by Jakob Haufe Usage: $0 [-hgpcs] [--genmeta] [--defaultcrop=] [--preview] [--crop] [--stitch] {PDF file|.stitch file} @@ -114,7 +114,7 @@ if($genmeta) width => ($urx - $llx)*$defaultcrop, height => ($ury - $lly)*$defaultcrop, columns => int(sqrt($pdf->pages)), - rows => int(sqrt($pdf->pages)), + rows => POSIX::ceil($pdf->pages/int(sqrt($pdf->pages))), pageorder => [(1 .. $pdf->pages)], }; -- 2.39.5