Hi all,
I have find out that when i commented createthumb() function call, the script become able to upload large image size but i am unable identify the wrong syntax.
My php code is below
[PHP]
$newImage= $_FILES['newImage']['name'];
$name='img'.$_S ESSION['id'].'.jpeg';
$newImageName=' images/profile/'.$name;
move_uploaded_f ile($_FILES["newImage"]["tmp_name"],$newImageName) ;
$newwidth=110;
$newheight=110;
createthumb($ne wImageNameBig,$ newImageName,$n ewwidth,$newhei ght );
function createthumb($fi lename,$target, $newwidth,$newh eight )
{
// Get new sizes
list($width, $height) = getimagesize($f ilename);
// Get Proportional Dimensions
if ($width > $height) {
$thumb_w=$newwi dth;
$thumb_h=$heigh t*($newheight/$width);
}
if ($width < $height) {
$thumb_w=$width *($newwidth/$height);
$thumb_h=$newhe ight;
}
if ($width == $height) {
$thumb_w=$newwi dth;
$thumb_h=$newhe ight;
}
// Center Image
$x = ( $newwidth - $thumb_w ) / 2;
$y = ( $newheight - $thumb_h ) / 2;
// Load
$thumb = imagecreatetrue color($newwidth , $newheight);
$source = imagecreatefrom jpeg($filename) ;
// Change Background
$white = imagecoloralloc ate($thumb, 255, 255, 255);
imagefill($thum b, 0, 0, $white);
// Resize
imagecopyresize d($thumb, $source, $x, $y, 0, 0, $thumb_w, $thumb_h, $width, $height);
//imagecopyresamp led($thumb, $source, $x, $y, 0, 0, $thumb_w, $thumb_h, $width, $height);
// Output
imagejpeg($thum b, $target);
// Free Memory
imagedestroy($t humb);
imagedestroy($s ource);
}
[/PHP]