- attached 550last.png
Problem with gdrotate
PHP test script
if (isset($_GET['angle'])) {
$im = "/home/remi/Documents/remirh128.jpg";
$source = imagecreatefromjpeg($im) or die('Error opening file '.$filename);
$rotation = imagerotate($source, $_GET['angle'], 0);
header('Content-type: image/jpeg');
imagejpeg($rotation);
} else {
echo "<html><body><table><tr>";
for ($ang=0 ; $ang<=180 ; $ang +=15) {
printf("<td><img src='".$_SERVER['PHP_SELF']."?angle=$ang' /><br/>$ang</td>\n");
}
echo "</tr></table></body></html>";
}
First image is using PHP 5.5.0RC2 (bundled libgd) or using system libgd (latest master)
Comments (20)
-
reporter -
reporter - attached remirh128.jpg
Original test image
-
I can't reproduce using today's php-src (master and 5.5 branche). I fear you may be right about the compiler being a zealot. I tested on windows using vc11, can't try on linux before next week.
-
Account Deleted - changed status to resolved
Fixed in f2a06dd
-
Account Deleted - changed status to open
The rotation is indeed fixed, but the picture should be whole, not just the right lower corner.
-
- changed milestone to 2.1.0
-
- changed version to 2.1.0RC1
-
- changed version to 2.1.0RC2
-
Something is wrong on linux, not sure what yet, but can't reproduce on Windows.
I disabled all optimization too. See attached images.
-
- attached rot_bug.jpeg
Original picture and 15 degrees incremental rotation.
Even the 0 degree is wrong.
-
- marked as blocker
-
On a positive note, it happens only using system's gd. Everything works fine using same system (OS, gcc, flags) using bundled GD.
-
reporter PHP bundled version are also affected, see my results.
-
@remicollet can't reproduce here using -g3 -fno-inline -O0 -Wall
Using bundled GD with master/5.5, no issue. 0 degree and up works fine.
-
- attached rot_bug_bundled.jpeg
Using bundled lib
-
@remicollet oh right... angle still wrong. Bad to zero.
-
reporter - changed status to resolved
force signed computation, fix issue
#67→ <<cset 183935de849c>>
-
reporter Please check if this change don't introduce regression.
-
@remicollet Thanks! Good catch :)
Should add a note about having to use signed integer with these fixed point arithmetic macros, to avoid this bug to come back to us soon ;)
-
Account Deleted Fix bug00067 image names
→ <<cset 57e62fca8fc0>>
- Log in to comment
Here is image with latest PHP after http://git.php.net/?p=php-src.git;a=commitdiff;h=2f01e06786c6f4b2479fdb728bd26062d07208e0
So this patch this the angle issue, so should probably be applied to libgd.