PythonMagick draw line issue

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
JStephens
Posts: 1
Joined: 2011-05-12T07:56:00-07:00
Authentication code: 8675308

PythonMagick draw line issue

Post by JStephens »

Greetings,

I am hoping this is a place that can help me out with some PythonMagick problems. If not, my apologies.

Environment:
Linux 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux
ImageMagick 6.6.2-6 2010-12-02 Q16
PythonMagick 0.9.1-3ubuntu2

I am trying to draw a simple line on an image. Really basic stuff.

My script:

#!/usr/bin/env python
from PythonMagick import *
from PythonMagick._PythonMagick import *
pic = 'image.jpg'
img = Image()
img.read(pic)
width = img.size().width()
height = img.size().height()
line = DrawableLine(0, 0, width, height)
img.draw(line)
img.write('newimage.jpg')

My results:
Traceback (most recent call last):
File "./pmgk2.py", line 10, in <module>
img.draw(line)
Boost.Python.ArgumentError: Python argument types in
Image.draw(Image, DrawableLine)
did not match C++ signature:
draw(Magick::Image {lvalue}, std::list<Magick::Drawable, std::allocator<Magick::Drawable> >)
draw(Magick::Image {lvalue}, Magick::Drawable)

I have spent considerable time attempting to do what I had hoped would be a simple task. However, regardless of what I have tried, I am unable to get this to work.

Can anyone shed some light as to what I am doing wrong?

Thanks

JS
cbusse
Posts: 2
Joined: 2011-08-11T04:10:09-07:00
Authentication code: 8675308

Re: PythonMagick draw line issue

Post by cbusse »

Better late than never ;)

I had a similar problem using DrawableText and made a patch for pythonmagick to get it back to work.

I posted the patch here: viewtopic.php?f=1&t=19278
Post Reply