PHP image rotate looses quality after each rotation
<p>I'm currently using GD and some PHP to rotate images. After each rotation the quality of the image gets worse. Is there a better way to do this or is this expected?</p>

<pre><code>    $img = new ImageClass;
    list($original, $info) = $img-&gt;load($src);

    // Determine angle
    $angle = strtolower($angle);
    if( $angle == 'cw' || $angle == 'clockwise' ) $angle = 270;
    if( $angle == 'ccw' || $angle == 'counterclockwise' ) $angle = 90;

    $rgb = $img-&gt;hex2rgb($bg_color);
    $bg_color = imagecolorallocate($original, $rgb['r'], $rgb['g'], $rgb['b']);

    $new = imagerotate($original, $angle, $bg_color);
</code></pre>

<p>Is it possible to rotate the image client side with maybe jquery and then save the image via PHP to the server? I'm assuming this will help with the image quality.</p>
