I am currently using GD and some PHP to rotate images. After each rotation, the image quality deteriorates. Is there a better way to do this or is this expected?
$img = new ImageClass;
list($original, $info) = $img->load($src);
$angle = strtolower($angle);
if( $angle == 'cw' || $angle == 'clockwise' ) $angle = 270;
if( $angle == 'ccw' || $angle == 'counterclockwise' ) $angle = 90;
$rgb = $img->hex2rgb($bg_color);
$bg_color = imagecolorallocate($original, $rgb['r'], $rgb['g'], $rgb['b']);
$new = imagerotate($original, $angle, $bg_color);
Is it possible to rotate the client side of the image, possibly jquery, and then save the image via PHP to the server? I guess this will help with image quality.
source
share