Page 1 of 1

MagickWand / MagickSetGravity

Posted: 2008-05-17T03:31:09-07:00
by mkoppanen
Considering the following code; should the call to MagickSetGravity affect MagickCropImage? Currently testing with ImageMagick 6.4.1-2 and it does not seem to have any effect.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <wand/MagickWand.h>

int main() 
{
	MagickWandGenesis();

	MagickWand *m_wand = NewMagickWand();

	MagickReadImage( m_wand, "/tmp/test.png" );
	
	MagickSetGravity( m_wand, WestGravity );

	MagickCropImage( m_wand, 100, 100, 0, 0 );

	MagickWriteImage( m_wand, "/tmp/test2.png" );

	m_wand = DestroyMagickWand( m_wand );

	MagickWandTerminus();

	return 0;
}

Re: MagickWand / MagickSetGravity

Posted: 2008-05-17T10:47:41-07:00
by magick
The crop geometry is absolute. For a geometry that respects gravity, use MagickTransformImage().

Re: MagickWand / MagickSetGravity

Posted: 2008-05-21T08:04:27-07:00
by mkoppanen
Thanks!