Magick++ (6.6.7) Geometry bug

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
rich2449
Posts: 11
Joined: 2010-03-18T11:34:10-07:00
Authentication code: 8675308

Magick++ (6.6.7) Geometry bug

Post by rich2449 »

Hi there,

there is a bug in the file "\Magick++\lib\geometry.cpp", in the function which generates a text string of the current geometry parameters (starts on line 277).

// Return geometry string
Magick::Geometry::operator std::string() const

When generating the x & y offset text an extra '+' is inserted before the offset, leading to positive offsets being rendered as "++x++y", and negative as "-+x-+y", this breaks the code which reads the geometry strings (GetGeometry(...)) causing the x & y offsets to always be read as 0,0.

Lines in questions:
>307

Code: Select all

      FormatMagickString( buffer, MaxTextExtent, "%+.20g", (double) _xOff);
should be:

Code: Select all

FormatMagickString( buffer, MaxTextExtent, "%.20g", (double) _xOff);
>315

Code: Select all

FormatMagickString( buffer, MaxTextExtent, "%+.20g", (double) _yOff);
should be:

Code: Select all

FormatMagickString( buffer, MaxTextExtent, "%.20g", (double) _yOff);
Thanks,
Rich
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Magick++ (6.6.7) Geometry bug

Post by magick »

Thanks for the problem report and patch. We'll get the patch into ImageMagick 6.6.7-5 Beta by sometime tomorrow.
Post Reply