Hi
The following code works on my computer but when i load it onto the server it works until it gets to imagecreatefromjpeg line then the program stops , the folders are all 0777
What i am trying to do is to scan through a folder and resize all images in that folder and move the resized images to a different folder
Any Idea what the problem could be
<?php
$dir = 'test';
$files2 = scandir($dir, 1);
$count=count($files2)-2;
for($i=0; $i<$count;$i++)
{
$uploadedfile ="test/".$files2[$i];
$resizedfile="pic/".$files2[$i];
list($width,$height)=getimagesize($uploadedfile);
$newwidth=330;
$newheight=($height/$width)*280;
if(($height/$width)<1.3){$newheight=($height/$width)*340;}
$tmp=imagecreatetruecolor($newwidth,$newheight);
$src =imagecreatefromjpeg($uploadedfile);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($tmp,$resizedfile,90);
}
?>