Page 1 of 1

A bug in decorate.c (Frame Image) ?

Posted: 2011-12-03T16:17:54-07:00
by spok
I'm using magick++ but it seems the bug is in a .c file, so I post the message here...

if I apply the following code on the following image I got the following exception :
"Magick: FrameIsLessThanImageSize
'<my file name>'@error/decorate.c/FrameImage/214"

I have tried 2 other images and got the same exception.

Is it a bug ?

the code :

Code: Select all

	
Magick::Geometry geoB(5,5,-2,-2);
picture.border(geoB);

Magick::Geometry geoE(1126,917,-158,-129);
picture.extent(geoE,"white");

picture.frame(55,55,28,28);
the pic :

Image

Re: A bug in decorate.c (Frame Image) ?

Posted: 2011-12-03T16:40:01-07:00
by magick
Cut your borders in half since there are two of them: picture.frame(55,55,14,14).

Re: A bug in decorate.c (Frame Image) ?

Posted: 2011-12-03T17:18:10-07:00
by spok
ok. Thanks. I think I have understand what happens.
The 2 first parameters of the the frame method must be at least egal to the sum of the inner and outer bevel (which means the center part of the frame is nul). So 28+28=56. Changing 55 by 56 resolves the problem.
Thank you.

However I have another question :
in the documentation, the frame method takes 6 parameters : size_t width_, size_t height_, ssize_t x_, ssize_t y_, ssize_t innerBevel_ = 0, ssize_t outerBevel_ = 0

while in the source file it has only 4 parameters...

what are the ssize_t x_ and ssize_t y_ parameters ?

Re: A bug in decorate.c (Frame Image) ?

Posted: 2011-12-03T17:50:54-07:00
by magick
The Magick++ frame method accept 4 values, the width, height, and inner and outer bevel. The command line and MagickCore API accept 6 parameters, the width, height, x and y offset, and inner and outer bevel.