Please correct me if I am wrong, but in 2014 we can rotate jpeg images, not without loss of quality, but seriously reducing it.
The Imagejpeg method has an argument of "quality", which helps to establish the desired preservation of quality. 100 for the value is excellent.
I tried several times to rotate the same image, and the loss of quality is actually not visible to human eyes.
Here is the code.
header("Content-type: image/jpeg"); $source = imagecreatefromjpeg($pictureUrl); $rotate = imagerotate($source, $degrees, 0); imagejpeg($rotate, $pictureUrl, 100); imagedestroy($source); imagedestroy($rotate);
source share