A
A
Alexander Alexandrovich2013-12-28 20:51:28
PHP
Alexander Alexandrovich, 2013-12-28 20:51:28

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

1 answer(s)
V
Vitaly Arkhipov, 2013-12-28
@arvitaly

$imfile
$infile
Enable error display

ini_set('display_errors',true);error_reporting(E_ALL);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question