Page 1 of 1
MagickWand API underdocumented
Posted: 2011-04-17T10:42:33-07:00
by yecril71pl
I find the
MagickWand API insufficiently documented.
For example:
NewImageMagick: returns a wand required for all other methods in the API. +[Throws an exception upon failure. Use
DestroyMagickWand to dispose. ]+
This is C API, we do not have implicit RAII here!
- Can the pair Genesis/Terminus be called multiple times?
- Are they idempotent?
- Must the calls be balanced?
- Are they reentrant?
Re: MagickWand API underdocumented
Posted: 2011-04-17T11:34:24-07:00
by magick
Can the pair Genesis/Terminus be called multiple times?
Yes.
Are they idempotent?
Yes.
Must the calls be balanced?
No, but recommended.
Are they reentrant?
Yes.
We added some more details to the NewMagickWand() methods. We expand the API documentation as time permits. Like many open-source projects we suffer from more work than volunteers.
Re: MagickWand API underdocumented
Posted: 2011-04-20T03:46:41-07:00
by yecril71pl
magick wrote:Like many open-source projects we suffer from more work than volunteers.
I have had to deal a lot with closed-source companies like Microsoft (I would give a hyperlink here but
BBcode does not allow me to say rel="nofollow"); I would say your performance, your competence and your overall attitude is wonderful beyond comparison anyway.
Why do
DestroyDrawingWand and
DestroyPixelWand return pointers?
Re: MagickWand API underdocumented
Posted: 2011-04-20T20:21:04-07:00
by anthony
So you can assign them back into the original Wand pointers. The value returned is just NULL.
It makes the code a little more readable.
Re: MagickWand API underdocumented
Posted: 2011-04-21T05:28:25-07:00
by magick
It a secure programming technique. Always zero out pointers when you no longer use them. The Destroy*() methods simply return NULL.
Re: MagickWand API underdocumented
Posted: 2011-05-02T07:48:53-07:00
by yecril71pl
How do I interpret the value returned by
MagickSetImageType?
Re: MagickWand API underdocumented
Posted: 2011-05-02T07:50:42-07:00
by magick
On success, MagickTrue is returned. If MagickFalse is returned, check image->exception for the reason MagickSetImageType() failed.