Re: Bug in MagickAnnoteImage() if locale is set to de_DE.UTF-8
Bob Friesenhahn <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 28 May 2017, Marvin Gülker wrote: > Hi, > > I think I have found a bug in GraphicsMagick's Wand C API. The problem > is that the MagickAnnotateImage() function always positions the text it > is given at (0|0) no matter which actual values you pass for the X and Y > co-ordinates. This however only happens if the programme's locale is set > to de_DE.UTF-8; if the programme runs under en_US.UTF-8 everything works > as expected. There is a known problem in that parsing floating point numbers (e.g. numbers like "200.0") may fail if the locale uses different delimiter for the decimal point (e.g. "200,0"). The reason for this is that all text formats which include floating point numbers use traditional C/POSIX locale. Changing the numeric locale to something else causes the operating system's floating point parsing and generation to operate incorrectly. Is it possible that this is the problem causing the problem for you? Try adding (void) setlocale(LC_NUMERIC,"C"); after any preceding locale requests. GraphicsMagick does: (void) setlocale(LC_ALL,""); (void) setlocale(LC_NUMERIC,"C"); Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help