Sometimes imagerotate() PHP function doesn't work (no error, the image is simply not rotated), sometimes it works. It makes me crazy.
Here's my code:
if ($degrees == 90)
$degrees = 270;
elseif ($degrees == 270)
$degrees = 90;
// Chargement
$source = imagecreatefromjpeg($filename);
// Rotation
$rotate = imagerotate($source, $degrees, 0);
imagejpeg($rotate, $filename, 95);
// Libération de la mémoire
imagedestroy($source);
imagedestroy($rotate);
In the htaccess I set:
ExpiresActive Off
#ExpiresByType image/jpg "access plus 1 hour"
#ExpiresByType image/jpeg "access plus 1 hour"
#ExpiresByType image/png "access plus 1 hour"
so normally there is no cache.
Please help.