Text rotation bug?

From: Date: Tue, 24 Feb 2009 21:28:04 +0000
Subject: Text rotation bug?
Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-544@lists.php.net to get a copy of this message
In tracking down a reported problem with rotated text in gnuplot's png terminal, I found what appears to be a bug, or at least a limitation in libgd. Rotation angles outside the range -pi < angle < pi are slightly wrong or possibly just overly sensitive to the precision of the angle provided. In particular, rotation of +90 degrees (1.570796 radians) is fine But rotation of -270 degress (-4.712389 radians) is ever so slightly off. The rotation values were provided to greater precision than shown above. According to the original reporter, the problem is visible with libgd 2.0.34 and several earlier versions. I have not been able to reproduce it myself using 2.0.35 built from source, but I don't know if that is because something was fixed or whether it is a difference in machine configurations, math libraries, compilers or what, exactly. I can work around this in gnuplot by adjusting angles to lie in the range [-pi : pi], but I suggest that libgd should do the same internally. Probably angles within some slop factor of N*(pi/2) should be "snapped" to perfect alignment. Ethan -- Ethan A Merritt

« previous php.gd.devel (#544) next »