thewhistler1
Technical User
I am creating a website that allows uploading of images. The images are resized to certain specs, then placed into a folder. One problem I have is when I upload and resize a photo that is taller than it is wide the photo actually rotates 90 degrees. I am using imagecopyresampled to resize the image. Like this:
My question is how to make that function stop rotating my images.
Thanks
Code:
$uploadedfile = $_FILES['uploadfile']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
list($width,$height)=getimagesize($uploadedfile);
$newheight=350;
$newwidth=($width/$height)*350;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
$filename = $target;
imagejpeg($tmp,$filename,100);
imagedestroy($src);
imagedestroy($tmp)
My question is how to make that function stop rotating my images.
Thanks