Answer the question
In order to leave comments, you need to log in
Thumbnails
Guys, I want to make a thumbnail image.
I upload an image, but I get only a completely black image of the right size.
copy($myfile,"gallery/$myfile_name");
function imageresize($outfile, $imfile, $neww, $newh, $quality)
{
$im = imagecreatefromjpeg($infile);
$im1 = imagecreatetruecolor($neww,$newh);
imagecopyresampled($img1, $im, 0,0,0,0, $neww, $newh, imagesx($im), imagesy($im));
imagejpeg($im1, $outfile, $quality);
imagedestroy($im);
imagedestroy($im1);
}
imageresize($f_thum, "gallary/$myfile_name", 160,100, 100);
Answer the question
In order to leave comments, you need to log in
$imfile
$infile
Enable error display
ini_set('display_errors',true);error_reporting(E_ALL);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question