The following test program demonstrates a problem with the
clip-path
primitive in 6.2.8-8. The clipping path seems to be
"clipped" on the
right and bottom. This program produces a correct image with
6.2.7.
The "Flower_Hat.jpg" image is from http://studio.imagemag
ick.org/
RMagick/doc/ex/images/Flower_Hat.jpg but I suspect any image
will do
to demonstrate the problem.
Please let me know if you need any more information. This is
not
causing me any particular problem - just thought you'd want
to know.
/*
Version: ImageMagick 6.2.8 08/05/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
gcc `Magick-config --cflags --cppflags` clip_path.c
`Magick-config --
ldflags --libs` -o clip_path
*/
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <magick/api.h>
int main(int argc,char **argv)
{
Image *canvas;
ImageInfo *image_info;
PixelPacket white = {MaxRGB, MaxRGB, MaxRGB,
OpaqueOpacity};
ExceptionInfo exception;
DrawInfo *pr;
const char * const primitives =
"push defs\n"
"push clip-path example\n"
"push graphic-context\n"
"polygon
145,65,174,151,264,151,192,205,218,291,145,240,72,291,98,205
,26,151,116,
151\n"
"pop graphic-context\n"
"pop clip-path\n"
"pop defs\n"
"clip-path example\n"
"image Over 0,0,290,363
'Flower_Hat.jpg'\n";
InitializeMagick("clip-path");
image_info=CloneImageInfo((ImageInfo *) NULL);
pr = CloneDrawInfo(image_info, NULL);
CloneString(&(pr->primitive), primitives);
GetExceptionInfo(&exception);
image_info->size =
AcquireMemory(sizeof("290x363"));
strcpy(image_info->size, "290x363");
image_info->background_color = white;
canvas=AllocateImage(image_info);
assert(canvas != NULL);
SetImage(canvas, OpaqueOpacity);
DrawImage(canvas, pr);
DisplayImages(image_info,canvas);
DestroyDrawInfo(pr);
DestroyImage(canvas);
DestroyImageInfo(image_info);
DestroyMagick();
exit(0);
}
_______________________________________________
Magick-bugs mailing list
Magick-bugs imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-
bugs
|