test code? esp for control over image density?
Posted by Victor Ng on Feb 13, 2008 @ 05:09am UTCReplies
-
Reply Re: test code? esp for control over image density?
No test code yet ... would be testing MagickWand functionality more than the bindings at this point. Current usage is the same as the existing Python MagickWand bindings referenced from the ImageMagick website.
As for performing the conversion in a build process, it's possible but why? The MagickWand API more than likely won't change, at least not often. Also, h2xml requires the ImageMagick source, or at least the .h files, in order to function.
-
Reply Re: test code? esp for control over image density?
Here's what I did to generate the file on a Linux box, assuming ImageMagick source in /tmp, ghostscript src in /tmp and ctypeslib easy_installed:
cd /tmp/ImageMagick-6.3.8
h2xml.py wand/MagickWand.h wand/magick-image.h -I /tmp/ImageMagick-6.3.8 -I /tmp/ghostscript-8.61/src -o /tmp/wand.xml# Some numbers were appended with 'u' and xml2py complained
cd /tmp
sed -i.bak "s/u\"/\"/" wand.xmlpython2.5 -m ctypeslib.xml2py -l/usr/lib/libWand.so.9.0.0 wand.xml > wand.py
The rest is what you see in source control.
I needed ghostscript src because h2xml complained when it couldn't some ghostscript .h files. Presumably you could install a devel version of gs, but I couldn't find one with the appropriate headers.
Just wondering if you have any code which i can use to try this out?
I've installed gccxml from MacPorts - should I expect any problems with that?
I'd really like to see the whole h2xml, xml2py conversion run during the build process if that's realistic...