14
0
Files
python-python-poppler/fix-image-argb.patch
Steve Kowalik 34d620d852 - Update to 0.4.1:
* Fix non-pure build for meson-python
  * Tested with Python 3.11 and Poppler 23.04.0
  * Minimal supported Python version is now 3.7
  * Tested with Python 3.11 and Poppler 23.03.0
  * Build system is now meson, and package is PEP-517 compliant
  * Tested with Python 3.10 and Poppler 22.04.0
  * EmbeddedFile data() and checksum() now return bytes
  * Bugfix: Fixed typos in EmbeddedFile.modification_date and
    EmbeddedFile.is_valid
  * Bugfix: Fixed typo in page.search
  * Bugfix: Fix underscore position in two attributes of the Rotation Enum
  * Bugfix: Reading pdf_version now requires unlocked document
  * Bugfix: Ensure document was loaded before creating Document object
- Drop patch fix-image-argb.patch, no longer required.
- No longer use disabled service to update, we don't need to clean up
  pybind11 sources, switch to the GitHub tarball to keep the testsuite.
- Refresh patch use-system-pybind11.patch to work with meson.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-poppler?expand=0&rev=9
2025-01-13 01:29:49 +00:00

24 lines
833 B
Diff

Index: b/src/cpp/image.cpp
===================================================================
--- a/src/cpp/image.cpp
+++ b/src/cpp/image.cpp
@@ -93,7 +93,11 @@ PYBIND11_MODULE(image, m)
.value("bgr24", image::format_enum::format_bgr24)
#endif
.export_values()
+#if PYBIND11_VERSION_MAJOR >= 2 && PYBIND11_VERSION_MINOR >= 6
+ .def("__str__", &format_to_str, "Image format used by PIL converters.", py::prepend());
+#else
.def("__str__", &format_to_str, "Image format used by PIL converters.");
+#endif
py::class_<image>(m, "image", py::buffer_protocol())
.def(py::init<>())
@@ -114,4 +118,4 @@ PYBIND11_MODULE(image, m)
m.def("supported_image_formats", &image::image::supported_image_formats);
}
-} // namespace poppler
\ No newline at end of file
+} // namespace poppler