PythonMagick_writeImages

C

Cousin Stanley

I'm trying to get PythonMagick going using ....

Enthought Edition Python 2.3
PythonMagick-0[1].5-Q16.python23.win32.exe

The following small example script from the old PythonMagick tutorial
worked for me just as coded below using Python 2.2.1 and an earlier release
of PythonMagick, which has been uninstalled, but now throws
TypeError: bad argument type when calling the writeImages( .... ) function ....

# animate1.py --------------------------------------------------------------

from PythonMagick import *

img1 = Image( './img/01.jpg' )

img1.scale( "100x100" )

img2 = Image( img1 )

img2.blur( 5 , 1.5 )

imgs = animateImages( [ img1 , img2 ] )

writeImages( imgs , './out/a1_kirstin.gif' , 1 ) # Line 14 .... Problem occurs here

# ------------------------------------------------------

python animate1.py
Traceback (most recent call last):
File "animate1.py", line 14, in ?
writeImages( imgs , './out/a1_kirstin.gif' , 1 )
TypeError: bad argument type for built-in operation
Magick: Failed to close module ("UnregisterJPEGImage: The operation completed successfully.").

# ---------------------------------------------------------

The only documentation I've found about writeImages()
is from some Magick++ docs, but I'm unsure how to
actually interpret it as my C++ experience is almost non-existent ....

http://www.imagemagick.org/www/Magick++/STL.html

writeImages InputIterator first_,
InputIterator last_,
const std::string &imageSpec_,
bool adjoin_ = true


Write images in container to file specified by string imageSpec_.

Set adjoin_ to false to write a set of image frames via a wildcard imageSpec_
(e.g. image%02d.miff).

The wildcard must be one of %0Nd, %0No, or %0Nx.

Caution: if an image format is selected which is capable of supporting fewer colors
than the original image or quantization has been requested, the original image will be
quantized to fewer colors. Use a copy of the original if this is a problem.

# ---------------------------------------------------------------------------------------------------

All of the other PythonMagick examples from the original tutorial
seem to work OK except the two that compose animated GIFs
using the writeImage function ....

Any clues ????
 
A

Achim Domma

Hi,
TypeError: bad argument type for built-in operation
Magick: Failed to close module ("UnregisterJPEGImage: The operation
completed successfully.").

the last line seems to be the real error. PythonMagick is only a wrapper
around GraphicsMagick. To me it looks like this is not a problem of the
wrapper, but of GraphicsMagick. You might subscribe to the GraphicsMagick
APIs Mailinglist and ask Bob about this error.

regards,
Achim
 
C

Cousin Stanley

Achim ....

This problem doesn't seem to be unique to JPG files
and also shows up with the wxPython/PythonMagick example
in the current tutorial posted at ....

http://www.procoders.net/moinmoin/PythonMagick

python wxp_pm.py
Magick: Failed to close module ("UnregisterPNGImage: The operation completed suc
cessfully.
").
Magick: Failed to close module ("UnregisterRGBImage: The operation completed suc
cessfully.

As with most of the simple examples from the original PythonMagick tutorial,
with the exception of the writeImages function noted in my original post
and a different problem with example4.py , this wxp_pm.py program seems to do
the desired image processing as expected in spite of the Failed to close module
error ....

The versions of the original PythonMagick tutorial that I use
along with their output images can be found at ....

http://fastq.com/~sckitching/Python/PythonMagick_tut_0.zip
[ 248 KB ]

It would be interesting to know if these run OK
with the Standard Python 2.3 distribution in order
to determine if there might be some quirk with
the Enthought Edition or with my setup ....

In the meantime, I will look for the GraphicsMagick API mailing list ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top