Rotating images with PHP reduces quality especially over about 10-20 actions
- by Dylan Cross
I am using this code below to rotate my jpeg images, the problem is that after around 10-20 times of rotating the image the image is dramatically lower quality, especially blue skies and such, my question is how can I keep these images the same high quality image? There must be a way. I mean, i keep the original image on the server for each image uploaded, and I don't do anything to that, so if need be it, I guess I could always come up with some way of using that over whenever possible.. But would rather not have to.
$source = imagecreatefromjpeg($filename);
$rotate = imagerotate($source, 90, 0);
imagejpeg($rotate, $filename ,100);