]> git.sur5r.net Git - pdfstitch/commitdiff
Fix row calculation to include all pages
authorJakob Haufe <sur5r@sur5r.net>
Wed, 22 Jun 2022 08:37:16 +0000 (10:37 +0200)
committerJakob Haufe <sur5r@sur5r.net>
Wed, 22 Jun 2022 08:37:16 +0000 (10:37 +0200)
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

index a754d0ad60ff02c7eeb7659f51ccc8b067e13c82..3fb8b3347dc79585dcb0d7f147c1c373db80837b 100755 (executable)
--- a/pdfstitch
+++ b/pdfstitch
@@ -22,7 +22,7 @@ Getopt::Long::Configure("bundling");
 
 
 my $usage = <<ENDUSAGE;
-pdfstitch - Copyright (C) 2017 by Jakob Haufe <sur5r\@sur5r.net>
+pdfstitch - Copyright (C) 2017-2022 by Jakob Haufe <sur5r\@sur5r.net>
 
 Usage: $0 [-hgpcs] [--genmeta] [--defaultcrop=<factor>] [--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)],
     };