Skip to content

Conversation

@bzamecnik
Copy link
Contributor

Building the wheel started failing after upgrade to poppler 25.01.

      ../src/cpp/image.cpp:105:10: note: in instantiation of function template specialization 'pybind11::class_<poppler::image>::def<poppler::image (poppler::image::*)() const, pybind11::arg_v>' requested here
        105 |         .def("copy", &image::copy, py::arg("rect") = rect())
            |          ^
      1 warning and 1 error generated.

From poppler changelog: "Remove rect parameter from image::copy, it was never implemented".

In src/cpp/image.cpp the image.copy() function should be now declared as:

.def("copy", &image::copy)

instead of:

.def("copy", &image::copy, py::arg("rect") = rect())

i.e. using the HAS_VERISON (fixed like this in the PR):

#if HAS_VERSION(25, 1)
        .def("copy", &image::copy)
#else
        .def("copy", &image::copy, py::arg("rect") = rect())
#endif

It might be also good to upgrade ubuntu/poppler in .github/workflows/build_and_test.yml.

- from poppler changelog: "Remove rect parameter from image::copy,
  it was never implemented"
@dgravitate
Copy link

This worked for me as well.

@dgravitate dgravitate mentioned this pull request Jan 22, 2025
@alikefia
Copy link

alikefia commented Mar 5, 2025

Yet another one #96 (have not seen this PR)
Dropped the param from the python side.
Hope we will have it IN...

@philpax
Copy link

philpax commented Mar 5, 2025

For reference, how to refer to this PR in your requirements.txt:

python-poppler @ git+https://github.com/bzamecnik/python-poppler.git@fix_image_copy # Poppler 25.01 changed the signature of a bound function, and python-poppler upstream hasn't updated yet.

- it's not available in the C++ API
- also remove it from the Python API, it was an optional argument anyway
@dov
Copy link

dov commented Jul 11, 2025

I failed installing this package with poppler 25 on fedora 42 due to this issue. Applying it fixed the problem. Thanks!

But why isn't the PR merged? Is python-poppler maintained?

@vbraun
Copy link

vbraun commented Aug 1, 2025

This branch works for me, too (Fedora 42)

From the Poppler changelog (https://poppler.freedesktop.org/releases.html)

Poppler 25.01 Releases
poppler-25.01.0.tar.xz (Thu Jan 2, 2025):
[...]

        cpp:
         * Remove rect parameter from image::copy, it was never implemented

So it is correct to follow upstream and remove the rect parameter here, too


def copy(self, rect=None):
image = self._image.copy(rect or Rectangle()._rect)
def copy(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how sure are we that no consumer used the rect argument (even if never implemented by the underlying library)?

If we're not sure, we'll have to keep the argument around (emitting a warning when it's non-None, maybe?)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those would have been good questions by upsteam to ask themselves before making a breaking change.

But FWIW they made the choice to remove the parameter without backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants