You are not logged in.

#1 2018-11-23 12:48:46

olk
Member
Registered: 2017-01-28
Posts: 10

PythonMagick fails: Boost.Python.ArgumentError -> Image.density()

Hi,

simple python script:

from PythonMagick import Image, Geometry

def convert(pdf, jpg):
    img = Image()
    img.density(Geometry(300, 300)) <-- fails
    img.magick("JPG")
    img.read(str(pdf))
    img.write(str(jpg))

fails with error:

Boost.Python.ArgumentError: Python argument types in
    Image.density(Image, Geometry)
did not match C++ signature:
    density(Magick::Image {lvalue})
    density(Magick::Image {lvalue}, Magick::Point)

I've already executed pacman -Syu

Last edited by olk (2018-11-23 16:50:15)

Offline

#2 2018-11-23 18:31:45

jamespharvey20
Member
Registered: 2015-06-09
Posts: 129

Re: PythonMagick fails: Boost.Python.ArgumentError -> Image.density()

Not an AUR question.  If below doesn't help, this is a learning current PythonMagick syntax or an upstream question.

It's saying density() needs a Point, but is being given a Geometry.  Those are different things.

In your defense, I do see some guides saying you can use a Geometry with density.  Maybe that's for an older version.  I don't use ImageMagick through python, but will throw a few things at you to try that I haven't tested:

img.density(300)
img.density(300, 300)
img.density("300")
img.density("300x300")
img.density(Point("300x300"))
img.density(Point(300, 300))

Offline

#3 2018-11-24 07:53:45

olk
Member
Registered: 2017-01-28
Posts: 10

Re: PythonMagick fails: Boost.Python.ArgumentError -> Image.density()

jamespharvey20 wrote:
img.density(300)
img.density(300, 300)
img.density("300")
img.density("300x300")
img.density(Point("300x300"))
img.density(Point(300, 300))

doesn't work

Offline

Board footer

Powered by FluxBB