I wrote this php function to resize images:
function resizeImage($file,$width,$height){
$size=getimagesize($file);
$src = imagecreatefromjpeg($file);
$dst = imagecreatetruecolor($width,$height);
imagecopyresampled($dst,$src,0,0,0,0,$width,$height,$size[0],$size[1]);
return $dst;
}
Unfortunately, certain images get rotated by 180 degrees when I use this function. What can I do about it?