14
0

Accepting request 880532 from home:frispete:python

- Add fix-image-argb.patch to fix image formatting with
  pybind11 >= 2.6.0

OBS-URL: https://build.opensuse.org/request/show/880532
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-poppler?expand=0&rev=4
This commit is contained in:
2021-03-22 14:47:10 +00:00
committed by Git OBS Bridge
parent 968ffdf893
commit d7b813ad8e
5 changed files with 28 additions and 18 deletions

23
fix-image-argb.patch Normal file
View File

@@ -0,0 +1,23 @@
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