Create thumbnail in php. Image isn't saved in file -
i'm trying save images thumbnail in php app. have following code thumbnail can not stored in file images/{image_name}.
$image_temp = $_files['uploaded_file']['tmp_name']; $image_size = $_files['uploaded_file']['size']; $image_name = $_files['uploaded_file']['name']; $image_type = $_files['uploaded_file']['type']; $size2 = getimagesize($image_temp); $width = $size2[0]; $height = $size2[1]; $thumbs_destination = 'images/'.$image_name; $newwidth = 100; $newheight = 100; $img = imagecreatefromjpeg($image_temp); $thumb = imagecreatetruecolor($newwidth, $newheight); imagecopyresampled($thumb, $img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($thumb, $thumbs_destination);
i want use own code rather plugin or code posted in forum need help
Comments
Post a Comment