Problem with gdrotate

Issue #67 resolved
Remi Collet created an issue

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)

  1. Pierre Joye

    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.

  2. Former user Account Deleted
    • changed status to open

    The rotation is indeed fixed, but the picture should be whole, not just the right lower corner.

  3. Pierre Joye

    Something is wrong on linux, not sure what yet, but can't reproduce on Windows.

    I disabled all optimization too. See attached images.

  4. Pierre Joye

    On a positive note, it happens only using system's gd. Everything works fine using same system (OS, gcc, flags) using bundled GD.

  5. Pierre Joye

    @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.

  6. Pierre Joye

    @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 ;)

  7. Log in to comment