Now I get
Parse error: parse error in /pictures/Camp/makenail.php on line 33
Line 33 is the "$errors. =ImageCopy($im,$src,0,0,$startx,$starty,$width,$height); " line.
<?php
Function MakeThumbNail($image,$dir,$height,$width,$clip=false,$startx="0",$starty="0") {
/*Make Thumbnail function
(C)2004 Bret Lanius Shell Lanius SWS Internet Technologies
You supply:
$image-image path
$dir-Path to place thumbnail
$height
$width
Optional $clip- false=whole image is copied True=Take clip from reigon
Optional $startx - where the clip region starts i.e. 0 would be upper right
Returns - success true or false. or $error messages if internal functions fail.
*/
//open image file
$errors=true;
$src=ImageCreateFromJpeg($image);
if (!$src) {
$errors="failded to create image file ";
}
$srcw=ImageSx($src);//Get Width and Height of original
$srch=ImageSy($src);
//create new empty image
$im = ImageCreate($height,$width);
if (!$im){$errors.=" Could not create image ";}
//copy image data
if ($clip){
$errors. =ImageCopy($im,$src,0,0,$startx,$starty,$width,$height);
}//end if clip
else{//Use whole image
$errors. =ImageCopyResampled($im,$src,0,0,0,0,$width,$heigh
t,$srcw,$srch);
}
//save file
//first extract filenmae only
$name=substr($image,strrpos($image,"/")+1);
$savefilename=$dir."/thumb".$name;
ImageJpeg($im,$savefilename);
ImageDestroy($src);
ImageDestroy($im);
return $errors;
}//end function MakeThumbNail
?>