A bug in decorate.c (Frame Image) ?

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

A bug in decorate.c (Frame Image) ?

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Cut your borders in half since there are two of them: picture.frame(55,55,14,14).
spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

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

Post 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 ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Post Reply