Bug#1142706: pdf2djvu: diff for NMU version 0.9.18.2-2.3

Nadzeya <[email protected]>
Newsgroups gmane.linux.debian.devel.bugs.rc
Message-ID <oyc6u5o365wuf23uglqmuipkt7y4abqrivit5o4gbngvb6pfoi__19340.7713597239$1786716195$gmane$org@rxwfjjq2cfuh>
Control: tags 1142706 + pending

Dear maintainer,

I've prepared an NMU for pdf2djvu (versioned as 0.9.18.2-2.3) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should cancel it.

Regards,
Nadzeya
pdf2djvu-0.9.18.2-2.3-nmu.diff (text/x-diff, 7.2 KB)
diffstat for pdf2djvu-0.9.18.2 pdf2djvu-0.9.18.2

 changelog                                  |    7 +
 patches/fix-ftbfs-with-poppler-26.07.patch |  154 +++++++++++++++++++++++++++++
 patches/series                             |    1 
 3 files changed, 162 insertions(+)

diff -Nru pdf2djvu-0.9.18.2/debian/changelog pdf2djvu-0.9.18.2/debian/changelog
--- pdf2djvu-0.9.18.2/debian/changelog	2026-05-03 00:57:21.000000000 +0200
+++ pdf2djvu-0.9.18.2/debian/changelog	2026-08-14 15:25:59.000000000 +0200
@@ -1,3 +1,10 @@
+pdf2djvu (0.9.18.2-2.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with poppler 26.07 (Closes: #1142706)
+
+ -- Nadzeya Hutsko <[email protected]>  Fri, 14 Aug 2026 15:25:59 +0200
+
 pdf2djvu (0.9.18.2-2.2) unstable; urgency=medium
 
   * Non-maintainer upload
diff -Nru pdf2djvu-0.9.18.2/debian/patches/fix-ftbfs-with-poppler-26.07.patch pdf2djvu-0.9.18.2/debian/patches/fix-ftbfs-with-poppler-26.07.patch
--- pdf2djvu-0.9.18.2/debian/patches/fix-ftbfs-with-poppler-26.07.patch	1970-01-01 01:00:00.000000000 +0100
+++ pdf2djvu-0.9.18.2/debian/patches/fix-ftbfs-with-poppler-26.07.patch	2026-08-14 14:56:08.000000000 +0200
@@ -0,0 +1,154 @@
+Description: Fix FTBFS with poppler >= 26.02
+ Several poppler API changes across the 26.02-26.07 releases break the
+ build:
+ - 26.02 dropped the SplashOutputDev reverseVideo parameter, made
+   GfxState::getCTM() return a const std::array<double, 6>& and made
+   SplashFont::getGlyph() take the clip by const SplashClip&
+ - 26.04 made Object::getString() return a const std::string&
+ - 26.05 removed the SplashCoord alias to double
+ - 26.06 made GfxColorSpace::getRGB() take a const GfxColor& and
+   Annot::getColor() return a const AnnotColor*
+ - 26.07 made Catalog::indexToLabel() take a std::string*
+ Each change is guarded by the existing integer POPPLER_VERSION check,
+ so older poppler still builds
+Author: Nadzeya Hutsko <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2161719
+Forwarded: no
+Last-Update: 2026-07-24
+--- a/pdf-backend.cc
++++ b/pdf-backend.cc
+@@ -164,7 +164,12 @@
+   pdf::gfx::RgbColor rgb_cc;
+   for (int i = 0; i < 4; i++)
+     cmyk_cc.c[i] = pdf::gfx::double_as_color_component(cmyk[i]);
++#if POPPLER_VERSION >= 260600
++  // poppler 26.06 changed getRGB() to take a const GfxColor &
++  cmyk_space.getRGB(cmyk_cc, &rgb_cc);
++#else
+   cmyk_space.getRGB(&cmyk_cc, &rgb_cc);
++#endif
+   rgb[0] = pdf::gfx::color_component_as_double(rgb_cc.r);
+   rgb[1] = pdf::gfx::color_component_as_double(rgb_cc.g);
+   rgb[2] = pdf::gfx::color_component_as_double(rgb_cc.b);
+@@ -176,7 +181,12 @@
+   std::string border_color;
+   if (annotation->getType() != pdf::ant::Annotation::typeLink)
+     return true;
++#if POPPLER_VERSION >= 260600
++  // poppler 26.06 made Annot::getColor() return a const AnnotColor *
++  const pdf::ant::Color *color = annotation->getColor();
++#else
+   pdf::ant::Color *color = annotation->getColor();
++#endif
+   if (color == nullptr)
+   {
+     border_colors.push_back("");
+@@ -411,7 +421,12 @@
+     char tzs = 0; int tzh = 0, tzm = 0;
+     if (!pdf::dict_lookup(info_dict, field.first, &object)->isString())
+       continue;
++#if POPPLER_VERSION >= 260400
++    // poppler 26.04 made Object::getString() return a const std::string &
++    const char *input = object.getString().c_str();
++#else
+     const char *input = pdf::get_c_string(object.getString());
++#endif
+     if (input[0] == 'D' && input[1] == ':')
+       input += 2;
+     int year = scan_date_digits(input, 4);
+@@ -474,7 +489,12 @@
+ bool pdf::Environment::antialias = false;
+ 
+ pdf::Renderer::Renderer(pdf::splash::Color &paper_color, bool monochrome)
++#if POPPLER_VERSION >= 260200
++// poppler 26.02 dropped the reverseVideo parameter
++: pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, paper_color)
++#else
+ : pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, false, paper_color)
++#endif
+ {
+   this->setFontAntialias(pdf::Environment::antialias);
+   this->setVectorAntialias(pdf::Environment::antialias);
+@@ -503,7 +523,10 @@
+     return false;
+   splash::ClipResult clip_result;
+   if (!font->getGlyph(code, 0, 0, bitmap, static_cast<int>(x), static_cast<int>(y),
+-#if POPPLER_VERSION >= 260100
++#if POPPLER_VERSION >= 260200
++      // poppler 26.02 made getGlyph() take the clip by const SplashClip &
++      splash->getClip(),
++#elif POPPLER_VERSION >= 260100
+       const_cast<SplashClip*>(&splash->getClip()),
+ #else
+       splash->getClip(),
+--- a/pdf-backend.hh
++++ b/pdf-backend.hh
+@@ -63,7 +63,12 @@
+     typedef ::Splash Splash;
+     typedef ::SplashColor Color;
+     typedef ::SplashFont Font;
++#if POPPLER_VERSION >= 260500
++    // poppler 26.05 removed the SplashCoord alias to double
++    typedef double Coord;
++#else
+     typedef ::SplashCoord Coord;
++#endif
+     typedef ::SplashPath Path;
+     typedef ::SplashGlyphBitmap GlyphBitmap;
+     typedef ::SplashBitmap Bitmap;
+--- a/pdf-document-map.cc
++++ b/pdf-document-map.cc
+@@ -41,11 +41,21 @@
+             std::unique_ptr<pdf::Document> doc(new pdf::Document(path));
+             pdf::Catalog *catalog = doc->getCatalog();
+             for (int i = 0; i < doc->getNumPages(); i++) {
++#if POPPLER_VERSION >= 260700
++                // poppler 26.07 made Catalog::indexToLabel take a std::string *
++                std::string s;
++                if (catalog->indexToLabel(i, &s)) {
++                    pdf::String gs(s);
++                    std::string str = pdf::string_as_utf8(&gs);
++                    this->labels.push_back(str);
++                }
++#else
+                 pdf::String s;
+                 if (catalog->indexToLabel(i, &s)) {
+                     std::string str = pdf::string_as_utf8(&s);
+                     this->labels.push_back(str);
+                 }
++#endif
+                 else
+                     this->labels.push_back("");
+                 global_index++;
+--- a/pdf-dpi.cc
++++ b/pdf-dpi.cc
+@@ -91,7 +91,12 @@
+ 
+ void DpiGuessDevice::process_image(pdf::gfx::State *state, int width, int height)
+ {
++#if POPPLER_VERSION >= 260200
++  // poppler 26.02 made getCTM() return a const std::array<double, 6> &
++  const double *ctm = state->getCTM().data();
++#else
+   const double *ctm = state->getCTM();
++#endif
+   double h_dpi = 72.0 * width / hypot(ctm[0], ctm[1]);
+   double v_dpi = 72.0 * height / hypot(ctm[2], ctm[3]);
+   this->min_ = std::min(this->min_, std::min(h_dpi, v_dpi));
+--- a/pdf-unicode.cc
++++ b/pdf-unicode.cc
+@@ -117,7 +117,13 @@
+ 
+ std::string pdf::string_as_utf8(pdf::Object &object)
+ {
++#if POPPLER_VERSION >= 260400
++    // poppler 26.04 made Object::getString() return a const std::string &
++    pdf::String s(object.getString());
++    return pdf::string_as_utf8(&s);
++#else
+     return pdf::string_as_utf8(object.getString());
++#endif
+ }
+ 
+ /* class pdf::FullNFKC
+
diff -Nru pdf2djvu-0.9.18.2/debian/patches/series pdf2djvu-0.9.18.2/debian/patches/series
--- pdf2djvu-0.9.18.2/debian/patches/series	2026-05-03 00:57:21.000000000 +0200
+++ pdf2djvu-0.9.18.2/debian/patches/series	2026-08-14 14:56:19.000000000 +0200
@@ -1,2 +1,3 @@
 compat-with-poppler-22.06.patch
 pdf2djvu-poppler-26.01.0.patch
+fix-ftbfs-with-poppler-26.07.patch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.