php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57892 rectangle() fails with non-english locale
Submitted: 2007-10-29 20:06 UTC Modified: 2007-10-30 12:28 UTC
From: jan at horde dot org Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jan at horde dot org
New email:
PHP Version: OS:

 

 [2007-10-29 20:06 UTC] jan at horde dot org
Description:
------------
It's actually PHP 5.2.3, but that shouldn't matter. Certain code fails when the locale is set to de_DE but works fine with C or en locales.

Reproduce code:
---------------
setlocale(LC_ALL, "de_DE");
$i = new Imagick();
$i->newImage(10, 10, new ImagickPixel("white"));
$d = new ImagickDraw();
$d->rectangle(0, 0, 1, 1);
$i->drawImage($d);

Actual result:
--------------
Fatal error: Uncaught exception 'ImagickException' with message 'Non-conforming drawing primitive definition `rectangle'' in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-30 05:49 UTC] scottmac@php.net
This looks like a bug in ImageMagick, internally it stores the information for rectangle as a string. This is interpreted as a decimal point rather than an x, y coordinate.

MvgPrintf(wand,"rectangle %g,%g %g,%g\n",x1,y1,x2,y2);

Which it reads as rectangle 0.0 1.1, hence the error here.
 [2007-10-30 08:06 UTC] jan at horde dot org
I would like to try a newer ImageMagick version to see if it's already fixed there. If not, you might have to workaround this in the extension code. A quick Google searched revealed that other projects using the library suffered from the same issue.

But unfortunately I can't link against a different library version because the location parameter that I can provide during "pecl install" is never considered. The build process always uses the system's ImageMagick library.
 [2007-10-30 12:28 UTC] mkoppanen@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 06:01:29 2025 UTC