Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package paperjam for openSUSE:Factory 
checked in at 2025-09-08 13:05:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/paperjam (Old)
 and      /work/SRC/openSUSE:Factory/.paperjam.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "paperjam"

Mon Sep  8 13:05:24 2025 rev:4 rq:1303144 version:1.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/paperjam/paperjam.changes        2023-03-02 
23:04:00.991968331 +0100
+++ /work/SRC/openSUSE:Factory/.paperjam.new.1977/paperjam.changes      
2025-09-08 13:05:41.513642004 +0200
@@ -1,0 +2,10 @@
+Mon Sep  8 07:36:33 UTC 2025 - Markéta Machová <[email protected]>
+
+- Update to version 1.2.2
+  * Compability with newer versions of libqpdf.
+  * Compile with C++17.
+  * Automatic page rotation based on the /Rotate key.
+  * Fixed bugs in selectors that walk pages backwards.
+- Refreshed reproducible.patch and stop_using_obsolete_standards.patch
+
+-------------------------------------------------------------------

Old:
----
  paperjam-1.1.1.tar.gz

New:
----
  paperjam-1.2.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ paperjam.spec ++++++
--- /var/tmp/diff_new_pack.09eZFY/_old  2025-09-08 13:05:42.065665203 +0200
+++ /var/tmp/diff_new_pack.09eZFY/_new  2025-09-08 13:05:42.065665203 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package paperjam
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           paperjam
-Version:        1.1.1
+Version:        1.2.2
 Release:        0
 Summary:        A tool for transforming PDF documents
 License:        GPL-2.0-or-later
@@ -28,7 +28,7 @@
 BuildRequires:  asciidoc
 BuildRequires:  gcc-c++
 BuildRequires:  libpaper-devel
-BuildRequires:  qpdf-devel
+BuildRequires:  qpdf-devel >= 11
 
 %description
 PaperJam is a tool for processing PDF documents: re-ordering pages,

++++++ paperjam-1.1.1.tar.gz -> paperjam-1.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/Makefile new/paperjam-1.2.2/Makefile
--- old/paperjam-1.1.1/Makefile 2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/Makefile 2025-08-10 01:32:44.000000000 +0200
@@ -1,5 +1,5 @@
-VERSION=1.1.1
-YEAR=2020
+VERSION=1.2.2
+YEAR=2025
 BUILD_DATE:=$(shell date '+%Y-%m-%d')
 BUILD_COMMIT:=$(shell if git rev-parse >/dev/null 2>/dev/null ; then git 
describe --always --tags ; else echo '<unknown>' ; fi)
 
@@ -8,7 +8,7 @@
 BINDIR=$(PREFIX)/bin
 MANDIR=$(PREFIX)/share/man
 
-CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++11 -g
+CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++17 -g
 
 all: paperjam paperjam.1 paperjam.1.html
 
@@ -43,7 +43,7 @@
        install -s paperjam $(DESTDIR)$(BINDIR)/
        install -m 644 paperjam.1 $(DESTDIR)$(MANDIR)/man1/
 
-release:
+release: paperjam.1.html
        git tag v$(VERSION)
        git push --tags
        git archive --format=tar --prefix=paperjam-$(VERSION)/ HEAD | gzip 
>paperjam-$(VERSION).tar.gz
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/NEWS new/paperjam-1.2.2/NEWS
--- old/paperjam-1.1.1/NEWS     2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/NEWS     2025-08-10 01:32:44.000000000 +0200
@@ -1,3 +1,17 @@
+Version 1.2.2 (2025-08-10)
+
+  o  Compability with newer versions of libqpdf.
+  o  Packaging for Debian Trixie.
+
+Version 1.2.1 (2024-10-04)
+
+  o  Compile with C++17.
+
+Version 1.2 (2022-08-21)
+
+  o  Automatic page rotation based on the /Rotate key.
+  o  Fixed bugs in selectors that walk pages backwards.
+
 Version 1.1.1 (2020-02-11)
 
   o  Several minor bug fixes, especially wrt. newer C++ compilers.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/TODO new/paperjam-1.2.2/TODO
--- old/paperjam-1.1.1/TODO     2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/TODO     2025-08-10 01:32:44.000000000 +0200
@@ -1,10 +1,14 @@
 - Integrate pdf-tools.cc with the rest of the code
-- What if an input page specifies /Rotate?
 - "-f" switch
 - What should do modulo(half) with an odd number of tuples? Improve, or at 
least document.
 - Modulo with last tuple incomplete: sometimes, not padding the last tuple can 
be useful
   (e.g., "flip every other page")
 - Document use of negative numbers in ranges
+- Allow use of page labels to refer to pages
+- Better range syntax for "from N to end" or "the whole document"
+- nup: allow stacking ("1 3 5 7" "2 4 6 8")
+- support "paper=a4r" for rotated A4
+- What to do with annotations?
 
 Ideas for further commands:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/cmds.cc new/paperjam-1.2.2/cmds.cc
--- old/paperjam-1.1.1/cmds.cc  2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/cmds.cc  2025-08-10 01:32:44.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *     PaperJam -- Commands
  *
- *     (c) 2018 Martin Mares <[email protected]>
+ *     (c) 2018--2022 Martin Mares <[email protected]>
  */
 
 #include <cassert>
@@ -25,41 +25,6 @@
 
 /*** Generic routines ***/
 
-// Transformed page
-
-class xform_page : public page {
-  page *orig_page;
-  pdf_matrix xform;
-public:
-  void render(out_context *out, pdf_matrix xform) override;
-  void debug_dump() override
-    {
-      debug("Transform [%s]", xform.to_string().c_str());
-      orig_page->debug_dump();
-    }
-  xform_page(page *p, pdf_matrix xf);
-};
-
-xform_page::xform_page(page *p, pdf_matrix xf)
-{
-  orig_page = p;
-  index = p->index;
-  xform = xf;
-
-  BBox media(p->width, p->height);
-  media.transform(xf);
-  width = media.width();
-  height = media.height();
-
-  image_box = p->image_box;
-  image_box.transform(xf);
-}
-
-void xform_page::render(out_context *out, pdf_matrix parent_xform)
-{
-  orig_page->render(out, xform * parent_xform);
-}
-
 // Commands acting on individual pages
 
 class cmd_exec_simple : public cmd_exec {
@@ -434,7 +399,7 @@
     {
       pdf_matrix m;
       m.shift(x, y);
-      return new xform_page(p, m);
+      return new xform_page(p, "move", m);
     }
 };
 
@@ -458,7 +423,7 @@
     {
       pdf_matrix m;
       m.scale(x_factor, y_factor);
-      return new xform_page(p, m);
+      return new xform_page(p, "scale", m);
     }
 };
 
@@ -483,27 +448,7 @@
     }
   page *process_page(page *p) override
     {
-      pdf_matrix m;
-      switch (deg)
-       {
-       case 0:
-         break;
-       case 90:
-         m.rotate_deg(-90);
-         m.shift(0, p->width);
-         break;
-       case 180:
-         m.rotate_deg(180);
-         m.shift(p->width, p->height);
-         break;
-       case 270:
-         m.rotate_deg(90);
-         m.shift(p->height, 0);
-         break;
-       default:
-         abort();
-       }
-      return new xform_page(p, m);
+      return new xform_page(p, "rotate", pdf_rotation_matrix(deg, p->width, 
p->height));
     }
 };
 
@@ -538,7 +483,7 @@
          m.scale(-1, 1);
          m.shift(p->width, 0);
        }
-      return new xform_page(p, m);
+      return new xform_page(p, "flip", m);
     }
 };
 
@@ -580,7 +525,7 @@
          int f = validate_page_index(pages, ps.from);
          int t = validate_page_index(pages, ps.to);
          int step = (f <= t) ? 1 : -1;
-         for (int i=f; i<=t; i += step)
+         for (int i=f; i != t + step; i += step)
            selected.push_back(pages[i]);
        }
       auto processed = run_command_list(pb->commands, selected);
@@ -817,7 +762,7 @@
     {
       BBox paper_box = BBox(paper.w, paper.h);
       pdf_matrix xf = pos.place(p->image_box, paper_box);
-      page *q = new xform_page(p, xf);
+      page *q = new xform_page(p, "paper", xf);
       q->width = paper.w;
       q->height = paper.h;
       return q;
@@ -845,7 +790,7 @@
       xf.scale(scale_to_fit(orig_box, paper_box));
       orig_box.transform(xf);
       xf.concat(pos.place(orig_box, paper_box));
-      page *q = new xform_page(p, xf);
+      page *q = new xform_page(p, "scaleto", xf);
       q->width = paper.w;
       q->height = paper.h;
       return q;
@@ -880,7 +825,7 @@
          xf.scale(scale_to_fit(orig_box, paper_box));
          orig_box.transform(xf);
          xf.concat(pos.place(orig_box, paper_box));
-         q = new xform_page(p, xf);
+         q = new xform_page(p, "fit", xf);
          q->width = paper.w;
          q->height = paper.h;
        }
@@ -889,7 +834,7 @@
          // No paper given: adjust paper to fit image
          xf.shift(-p->image_box.x_min, -p->image_box.y_min);
          xf.shift(marg.l, marg.b);
-         q = new xform_page(p, xf);
+         q = new xform_page(p, "fit", xf);
          q->width = p->image_box.width() + marg.l + marg.r;
          q->height = p->image_box.height() + marg.t + marg.b;
        }
@@ -915,7 +860,7 @@
     {
       pdf_matrix xf;
       xf.shift(marg.l, marg.b);
-      page *q = new xform_page(p, xf);
+      page *q = new xform_page(p, "expand", xf);
       q->width = p->width + marg.l + marg.r;
       q->height = p->height + marg.t + marg.b;
       if (q->width < 0.001 || q->height < 0.001)
@@ -938,7 +883,7 @@
   margins_cmd(cmd *c) : marg(c, "size", "") { }
   page *process_page(page *p) override
     {
-      page *q = new xform_page(p, pdf_matrix());
+      page *q = new xform_page(p, "margins", pdf_matrix());
       q->image_box = BBox(marg.l, marg.t, p->width - marg.r, p->height - 
marg.b);
       if (q->image_box.width() < 0.001 || q->image_box.height() < 0.001)
        err("Margins must result in positive image dimensions");
@@ -1469,7 +1414,7 @@
       vector<page *> out;
       for (auto p: pages)
        {
-         page *q = new xform_page(p, pdf_matrix());
+         page *q = new xform_page(p, "common", pdf_matrix());
          q->width = pbox.width();
          q->height = pbox.height();
          q->image_box = ibox;
@@ -1522,7 +1467,7 @@
            pdf_matrix xf = placement;
            xf.shift(-c*pw, -(rows-1-r)*ph);
            xf.shift(margin.l, margin.t);
-           page *q = new xform_page(p, xf);
+           page *q = new xform_page(p, "slice", xf);
            q->width = paper.w;
            q->height = paper.h;
            BBox slice_box = BBox(margin.l, margin.t, paper.w - margin.r, 
paper.h - margin.b);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/debian/compat 
new/paperjam-1.2.2/debian/compat
--- old/paperjam-1.1.1/debian/compat    2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/debian/compat    1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-11
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/debian/control 
new/paperjam-1.2.2/debian/control
--- old/paperjam-1.1.1/debian/control   2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/debian/control   2025-08-10 01:32:44.000000000 +0200
@@ -2,7 +2,7 @@
 Section: ucw
 Priority: optional
 Maintainer: Martin Mares <[email protected]>
-Build-Depends: debhelper (>=10~), asciidoc
+Build-Depends: debhelper-compat (= 13), asciidoc, libqpdf-dev, libpaper-dev
 Standards-Version: 4.1.4
 Homepage: http://mj.ucw.cz/sw/paperjam/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/jam.h new/paperjam-1.2.2/jam.h
--- old/paperjam-1.1.1/jam.h    2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/jam.h    2025-08-10 01:32:44.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *     PaperJam -- Common declarations
  *
- *     (c) 2018 Martin Mares <[email protected]>
+ *     (c) 2018--2022 Martin Mares <[email protected]>
  */
 
 #include <vector>
@@ -152,6 +152,7 @@
 extern bool recalc_bbox;
 extern int debug_level;
 extern int debug_indent;
+extern bool no_auto_transforms;
 
 class paperjam_error : public exception {
   string message;
@@ -175,3 +176,13 @@
 void process(list<cmd *> &cmds);
 vector<page *> run_command_list(list<cmd *> &cmds, vector<page *> &pages);
 vector<BBox> gs_bboxes(const char *in);
+
+class xform_page : public page {
+  page *orig_page;
+  pdf_matrix xform;
+  const char *description;
+public:
+  void render(out_context *out, pdf_matrix xform) override;
+  void debug_dump() override;
+  xform_page(page *p, const char *desc, pdf_matrix xf);
+};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/paperjam.1.txt 
new/paperjam-1.2.2/paperjam.1.txt
--- old/paperjam-1.1.1/paperjam.1.txt   2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/paperjam.1.txt   2025-08-10 01:32:44.000000000 +0200
@@ -35,6 +35,11 @@
 *-d, --debug*::
        Show debugging messages. Increases verbosity when given multiple times.
 
+*--no-auto*::
+       Do not perform automatic transforms. Currently, only one such transform
+       is implemented: rotation of pages based on the *Rotate* property of
+       page objects.
+
 *--help*::
        Show help on options and commands.
 
@@ -85,7 +90,7 @@
 The pipeline is enclosed in curly braces. It consists of one or more 'stages'
 separated by commas. Each stage has one or more 'page selectors' (page numbers
 or ranges) and an optional list of commands to apply on these pages (separated
-from the selectors by a semicolon).
+from the selectors by a colon).
 
 When a range is written backwards (the first page number is greater than the
 second one), the pages are processed in reverse order.
@@ -218,7 +223,7 @@
 
 *h=*'dimen', *v=*'dimen', *l=*'dimen', *r=*'dimen', *t=*'dimen', *b=*'dimen'::
        Adjust horizontal, vertical, left, right, top, and bottom margins.
-       See Margins above to see how these argument interact with each other.
+       See Margins above to see how these arguments interact with each other.
 
 fit
 ~~~
@@ -487,13 +492,13 @@
 HISTORY
 -------
 I conceived the idea of a document processor like PaperJam when struggling 
with pre-press
-formatting in the early 2000's. At that time, the basic ideas behind the 
language were born,
+formatting in the early 2000s. At that time, the basic ideas behind the 
language were born,
 but everything was deeply rooted in the then standard PostScript world. After 
some years,
 I managed to convince a student of mine Ales Snuparek to implement my ideas as 
his bachelor's project.
 He wrote the program PsPdfTool for transforming both PostScript and PDF 
documents, which turned
 out to be terribly useful.
 
-In the 2010's, limitations of the old design became clear and many PDF 
documents were using
+In the 2010s, limitations of the old design became clear and many PDF 
documents were using
 features not known to PsPdfTool (most prominently object streams). After 
several years of
 pondering, I became fond of the QPDF library and wrote PaperJam as a modern 
successor of
 PsPdfTool.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/paperjam.cc 
new/paperjam-1.2.2/paperjam.cc
--- old/paperjam-1.1.1/paperjam.cc      2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/paperjam.cc      2025-08-10 01:32:44.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *     PaperJam -- Main program
  *
- *     (c) 2018 Martin Mares <[email protected]>
+ *     (c) 2018--2022 Martin Mares <[email protected]>
  */
 
 #include <cassert>
@@ -17,6 +17,7 @@
 const char *in_name;
 const char *out_name;
 bool recalc_bbox;
+bool no_auto_transforms;
 int debug_level;
 int debug_indent;
 
@@ -69,6 +70,7 @@
 enum opt {
   OPT_HELP = 256,
   OPT_VERSION,
+  OPT_NO_AUTO,
 };
 
 static const struct option long_opts[] = {
@@ -88,11 +90,15 @@
 Options:\n\
 -b, --bbox             Recalculate bounding boxes\n\
 -d, --debug            Show debugging messages\n\
+    --no-auto          Disable automatic rotation of pages\n\
 \n\
 <command> = <name>(<args>, <named-arg>[=<value>], ...) [<pipeline>]\n\
 <pipeline> = { <stage>, <stage>, ... }\n\
 <stage> = <page> <page> ... [: <commands>]\n\
 \n\
+Example:\n\
+paperjam 'book nup(2, paper=a4)' input.pdf output.pdf\n\
+\n\
 Commands:\n\
 ");
   parser_help();
@@ -123,6 +129,9 @@
       case OPT_HELP:
        usage();
        return 0;
+      case OPT_NO_AUTO:
+       no_auto_transforms = true;
+       break;
       default:
        exit(1);
       }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/pdf-tools.cc 
new/paperjam-1.2.2/pdf-tools.cc
--- old/paperjam-1.1.1/pdf-tools.cc     2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/pdf-tools.cc     2025-08-10 01:32:44.000000000 +0200
@@ -1,12 +1,13 @@
 /*
  *     Auxiliary functions for processing PDF files
  *
- *     (c) 2018 Martin Mares <[email protected]>
+ *     (c) 2018--2022 Martin Mares <[email protected]>
  */
 
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
+#include <memory>
 
 #include <iconv.h>
 
@@ -229,7 +230,7 @@
        }
 
        vector<QPDFObjectHandle> contents = page.getPageContents();
-       auto ph = PointerHolder<QPDFObjectHandle::StreamDataProvider>(new 
CombineFromContents_Provider(contents));
+       auto ph = std::shared_ptr<QPDFObjectHandle::StreamDataProvider>(new 
CombineFromContents_Provider(contents));
        xo_stream.replaceStreamData(ph, QPDFObjectHandle::newNull(), 
QPDFObjectHandle::newNull());
        return xo_stream;
 }
@@ -247,3 +248,29 @@
                buf[--n] = 0;
        return buf;
 }
+
+/*** Rotation matrix construction ***/
+
+pdf_matrix pdf_rotation_matrix(int deg, double width, double height)
+{
+      pdf_matrix m;
+      switch (deg) {
+             case 0:
+                     break;
+             case 90:
+                     m.rotate_deg(-90);
+                     m.shift(0, width);
+                     break;
+             case 180:
+                     m.rotate_deg(180);
+                     m.shift(width, height);
+                     break;
+             case 270:
+                     m.rotate_deg(90);
+                     m.shift(height, 0);
+                     break;
+             default:
+                     abort();
+      }
+      return m;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/pdf-tools.h 
new/paperjam-1.2.2/pdf-tools.h
--- old/paperjam-1.1.1/pdf-tools.h      2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/pdf-tools.h      2025-08-10 01:32:44.000000000 +0200
@@ -143,5 +143,6 @@
 QPDFObjectHandle unicode_string(std::string s);
 QPDFObjectHandle page_to_xobject(QPDF *out, QPDFObjectHandle page);
 string pdf_coord(double x, uint digits=1);
+pdf_matrix pdf_rotation_matrix(int deg, double width, double height);
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/paperjam-1.1.1/pdf.cc new/paperjam-1.2.2/pdf.cc
--- old/paperjam-1.1.1/pdf.cc   2020-02-11 22:43:00.000000000 +0100
+++ new/paperjam-1.2.2/pdf.cc   2025-08-10 01:32:44.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *     PaperJam -- Low-level handling of PDFs
  *
- *     (c) 2018 Martin Mares <[email protected]>
+ *     (c) 2018--2022 Martin Mares <[email protected]>
  */
 
 #include <cassert>
@@ -33,6 +33,7 @@
   void render(out_context *out, pdf_matrix xform);
   void debug_dump() { debug("Input page %d", index); }
   in_page(QPDFObjectHandle inpg, int idx);
+  int get_rotate();
 };
 
 in_page::in_page(QPDFObjectHandle inpg, int idx)
@@ -75,6 +76,29 @@
   out->contents += "q " + m.to_string() + " cm " + xobj_res + " Do Q ";
 }
 
+int in_page::get_rotate()
+{
+  QPDFObjectHandle rotate = pdf_page.getKey("/Rotate");
+  if (rotate.isNull())
+    return 0;
+  else if (rotate.isInteger())
+    {
+      long long deg = rotate.getIntValue();
+      if (deg < 0 || deg >= 360 || deg % 90)
+       {
+         warn("Page #%d: /Rotate must be 0, 90, 180 or 270", index);
+         return 0;
+       }
+      else
+       return deg;
+    }
+  else
+    {
+      warn("Page #%d: /Rotate is not an integer", index);
+      return 0;
+    }
+}
+
 void debug_pages(vector<page *> &pages)
 {
   if (!debug_level)
@@ -96,6 +120,25 @@
     }
 }
 
+static vector<page *> apply_input_xforms(vector<page *> in_pages)
+{
+  vector<page *> out_pages;
+
+  for (auto pg: in_pages)
+    {
+      in_page * in_pg = dynamic_cast<in_page *>(pg);
+      if (in_pg)
+       {
+         int deg = in_pg->get_rotate();
+         if (deg)
+           pg = new xform_page(pg, "/Rotate", pdf_rotation_matrix(deg, 
pg->width, pg->height));
+       }
+      out_pages.push_back(pg);
+    }
+
+  return out_pages;
+}
+
 vector<page *> run_command_list(list<cmd *> &cmds, vector<page *> &pages)
 {
   debug("# Input");
@@ -142,7 +185,11 @@
     {
       const string to_copy[] = { "/Title", "/Author", "/Subject", "/Keywords", 
"/Creator", "/CreationDate" };
       for (string key: to_copy)
-       info.replaceOrRemoveKey(key, orig_info.getKey(key));
+        {
+          QPDFObjectHandle value = orig_info.getKey(key);
+          if (!value.isNull())
+            info.replaceKey(key, value);
+        }
     }
 }
 
@@ -165,6 +212,12 @@
   if (recalc_bbox)
     do_recalc_bbox(pages, in_name);
 
+  if (!no_auto_transforms)
+    {
+      debug("### Applying input transforms");
+      pages = apply_input_xforms(pages);
+    }
+
   debug("### Running commands");
   pages = run_command_list(cmds, pages);
 
@@ -282,3 +335,32 @@
   for (size_t i=0; i<pages.size(); i++)
     pages[i]->image_box = bboxes[i];
 }
+
+// Transformed page
+
+xform_page::xform_page(page *p, const char *desc, pdf_matrix xf)
+{
+  orig_page = p;
+  index = p->index;
+  description = desc;
+  xform = xf;
+
+  BBox media(p->width, p->height);
+  media.transform(xf);
+  width = media.width();
+  height = media.height();
+
+  image_box = p->image_box;
+  image_box.transform(xf);
+}
+
+void xform_page::debug_dump()
+{
+  debug("Transform (%s): [%s]", description, xform.to_string().c_str());
+  orig_page->debug_dump();
+}
+
+void xform_page::render(out_context *out, pdf_matrix parent_xform)
+{
+  orig_page->render(out, xform * parent_xform);
+}

++++++ reproducible.patch ++++++
--- /var/tmp/diff_new_pack.09eZFY/_old  2025-09-08 13:05:42.161669237 +0200
+++ /var/tmp/diff_new_pack.09eZFY/_new  2025-09-08 13:05:42.161669237 +0200
@@ -13,13 +13,13 @@
     
     This PR was done while working on reproducible builds for openSUSE.
 
-diff --git a/Makefile b/Makefile
-index 35e54a6..d685a8f 100644
---- a/Makefile
-+++ b/Makefile
+Index: paperjam-1.2.2/Makefile
+===================================================================
+--- paperjam-1.2.2.orig/Makefile
++++ paperjam-1.2.2/Makefile
 @@ -1,6 +1,6 @@
- VERSION=1.1.1
- YEAR=2020
+ VERSION=1.2.2
+ YEAR=2025
 -BUILD_DATE:=$(shell date '+%Y-%m-%d')
 +BUILD_DATE:=$(shell if [ -e .git ] ; then git log -1 --format=%cs ; else date 
-u -r NEWS '+%Y-%m-%d' 2>/dev/null || date '+%Y-%m-%d' ; fi)
  BUILD_COMMIT:=$(shell if git rev-parse >/dev/null 2>/dev/null ; then git 
describe --always --tags ; else echo '<unknown>' ; fi)

++++++ stop_using_obsolete_standards.patch ++++++
--- /var/tmp/diff_new_pack.09eZFY/_old  2025-09-08 13:05:42.177669910 +0200
+++ /var/tmp/diff_new_pack.09eZFY/_new  2025-09-08 13:05:42.181670078 +0200
@@ -15,7 +15,7 @@
 +BINDIR?=$(PREFIX)/bin
 +MANDIR?=$(PREFIX)/share/man
  
--CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++11 -g
+-CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++17 -g
 +CXXFLAGS?=-O2 -Wall -Wextra -Wno-parentheses -g
  
  all: paperjam paperjam.1 paperjam.1.html

Reply via email to