ImageMagick 6.5.0 crop behavior
Posted: 2009-04-01T11:55:16-07:00
Hello,
I am staring at the following code but can't really see how I end up the geometry at the end:
Outputs:
Geometry before first crop: 120x120
Geometry before second crop: 100x100
Geometry after second crop: 90x40
Where does the 90x40 come from?
I am staring at the following code but can't really see how I end up the geometry at the end:
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <wand/MagickWand.h>
int main() {
MagickWand *m_wand;
PixelWand *pixel;
MagickWandGenesis();
m_wand = NewMagickWand();
pixel = NewPixelWand();
MagickNewImage(m_wand, 200, 150, pixel);
MagickThumbnailImage(m_wand, 120, 120);
printf("Geometry before first crop: %dx%d\n", MagickGetImageWidth(m_wand), MagickGetImageHeight(m_wand));
MagickCropImage(m_wand, 100, 100, 10, 10);
printf("Geometry before second crop: %dx%d\n", MagickGetImageWidth(m_wand), MagickGetImageHeight(m_wand));
MagickCropImage(m_wand, 100, 40, 0, 30);
printf("Geometry after second crop: %dx%d\n", MagickGetImageWidth(m_wand), MagickGetImageHeight(m_wand));
m_wand = DestroyMagickWand(m_wand);
pixel = DestroyPixelWand(pixel);
MagickWandTerminus();
return 0;
}
Geometry before first crop: 120x120
Geometry before second crop: 100x100
Geometry after second crop: 90x40
Where does the 90x40 come from?