Giter VIP home page Giter VIP logo

Comments (2)

gagern avatar gagern commented on May 23, 2024

See also Gentoo bug 579848. Error report for me looks like this:

In file included from /usr/include/boost/python/object/make_instance.hpp:10:0,
                 from /usr/include/boost/python/object/make_ptr_instance.hpp:8,
                 from /usr/include/boost/python/to_python_indirect.hpp:11,
                 from /usr/include/boost/python/converter/arg_to_python.hpp:10,
                 from /usr/include/boost/python/call.hpp:15,
                 from /usr/include/boost/python/object_core.hpp:14,
                 from /usr/include/boost/python/args.hpp:25,
                 from /usr/include/boost/python.hpp:11,
                 from /var/tmp/portage/dev-python/pythonmagick-0.9.12/work/PythonMagick-0.9.12/pythonmagick_src/_Blob.cpp:3:
/usr/include/boost/python/converter/registered.hpp: In instantiation of ‘const boost::python::converter::registration& boost::python::converter::detail::registry_lookup1(boost::type<Target>) [with T = void]’:
/usr/include/boost/python/converter/registered.hpp:104:80:   required from ‘const boost::python::converter::registration& boost::python::converter::detail::registered_base<void>::converters’
/usr/include/boost/python/converter/arg_from_python.hpp:269:61:   required from ‘boost::python::converter::pointer_arg_from_python<T>::pointer_arg_from_python(PyObject*) [with T = void*; PyObject = _object]’
/usr/include/boost/python/arg_from_python.hpp:70:18:   required from ‘boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = void*; PyObject = _object]’
/usr/include/boost/preprocessor/iteration/detail/local.hpp:37:9:   required from ‘PyObject* boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(Magick::Blob&, void*, long unsigned int); Policies = boost::python::default_call_policies; Sig = boost::mpl::vector4<void, Magick::Blob&, void*, long unsigned int>; PyObject = _object]’
/usr/include/boost/python/object/py_function.hpp:38:33:   required from ‘PyObject* boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller<void (*)(Magick::Blob&, void*, long unsigned int), boost::python::default_call_policies, boost::mpl::vector4<void, Magick::Blob&, void*, long unsigned int> >; PyObject = _object]’
/var/tmp/portage/dev-python/pythonmagick-0.9.12/work/PythonMagick-0.9.12/pythonmagick_src/_Blob.cpp:44:1:   required from here
/usr/include/boost/python/converter/registered.hpp:93:30: error: no matching function for call to ‘registry_lookup2(void (*)())’
       return registry_lookup2((T(*)())0);
                              ^
/usr/include/boost/python/converter/registered.hpp:83:3: note: candidate: template<class T> const boost::python::converter::registration& boost::python::converter::detail::registry_lookup2(T& (*)())
   registry_lookup2(T&(*)())
   ^
/usr/include/boost/python/converter/registered.hpp:83:3: note:   template argument deduction/substitution failed:
/usr/include/boost/python/converter/registered.hpp:93:30: note:   mismatched types ‘T&’ and ‘void’
       return registry_lookup2((T(*)())0);
                              ^
Makefile:625: recipe for target 'libpymagick_la-_Blob.lo' failed
make[1]: *** [libpymagick_la-_Blob.lo] Error 1

In _Blob.cpp the following two lines are the problematic ones, and disabling them makes things compile:

    scope* Magick_Blob_scope = new scope(
    class_< Magick::Blob >("Blob", init<  >())
//-->   .def(init< const void*, size_t >())
        .def(init< const Magick::Blob& >())
        .def("base64", (void (Magick::Blob::*)(const std::string) )&Magick::Blob::base64)
        .def("base64", (std::string (Magick::Blob::*)() )&Magick::Blob::base64)
        .def("update", &update_wrapper)
//-->   .def("updateNoCopy", &Magick::Blob::updateNoCopy, Magick_Blob_updateNoCopy_overloads_2_3())
        .def("length", &Magick::Blob::length)
    );

There are other, similar issues in _Image.cpp, perhaps in other files as well.

I must confess that I fail to see the intended use case of these method bindings. How would one provide a void* from within Python? I can see how it might be convenient to allow using buffers to specify the content for some chunk of memory, but I haven't found any indication in the Boost manual that boost::python could do auto-conversion of buffers to void* and size_t pairs.

So as it stands, I'd guess that these methods are currently not usable in any way, and therefore can be removed. They might be replaced at a later time with something using buffers, but that would require more code. Do you agree?

from pythonmagick.

mikayla-grace avatar mikayla-grace commented on May 23, 2024

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/PythonMagick later today.

from pythonmagick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.