i searched all the previous posts regarding this subject and still not found my answer..
im gonna post the code so dat someone will be able to tell me why i get a black block instead of the thumbnail format of the original image..
please note that ther is no database from where i call these images..they are just folders.
Code: Select all
$n_width="80"; // Fix the width of the thumb nail images
$n_height="80"; // Fix the height of the thumb nail imaage
$tsrc="thimg/$fname";
$msrc="upimg/$fname";
// Path where thumb nail image will be stored
if (!($ftype =="image/pjpeg" OR $ftype=="image/gif"))
{
if($ftype=="image/jpeg")
{
$im=@imagecreatefromjpeg($fname);
$width=imageSX($im); // Original picture width is stored
$height=imageSY($im); // Original picture height is stored
$newimage=imagecreatetruecolor($n_width,$n_height);
imagecopyresampled($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
imagejpeg($newimage,$tsrc);
imagecolorallocate($im,0,0,0);
chmod("$tsrc",0777);
chmod("$msrc",0777);