I believe this code should do it, but it doesn't honor my gravity request, instead I always get the top left corner of the image.
Either this is a bug, or there is some other method I am unaware of to do gravity crops with MagickWand.
Code: Select all
#include <wand/MagickWand.h>
int main()
{
MagickWand *m_wand = NewMagickWand();
MagickWand *t_wand = NewMagickWand();
MagickReadImage( m_wand, "input.jpg" );
MagickSetGravity( m_wand, CenterGravity );
t_wand = MagickTransformImage( m_wand, "50x50+0+0", "" );
MagickWriteImage( t_wand, "output.jpg" );
m_wand = DestroyMagickWand( m_wand );
return 0;
}
Any thoughts would be appreciated.
--maqr