Page 1 of 1

Magick++ (6.6.7) Geometry bug

Posted: 2011-02-01T17:42:19-07:00
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

Re: Magick++ (6.6.7) Geometry bug

Posted: 2011-02-01T18:05:19-07:00
by magick
Thanks for the problem report and patch. We'll get the patch into ImageMagick 6.6.7-5 Beta by sometime tomorrow.