Code: Select all
function makethumb($sourcefile, $destfile, $imgcomp = 0)
{
$g_srcfile=$sourcefile;
$g_dstfile=$destfile;
if(file_exists($g_srcfile))
{
$g_is=getimagesize($g_srcfile);
$g_fw=$g_isї0]/4;
$g_fh=$g_isї1]/4;
if(($g_isї0]-$g_fw)>=($g_isї1]-$g_fh))
{
$g_iw=$g_fw;
$g_ih=($g_fw/$g_isї0])*$g_isї1];
}
else
{
$g_ih=$g_fh;
$g_iw=($g_ih/$g_isї1])*$g_isї0];
}
$img_src=imagecreatefromjpeg($g_srcfile);
$img_dst=imagecreate($g_iw,$g_ih);
imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih, $g_isї0], $g_isї1]);
imagejpeg($img_dst, $g_dstfile);
imagedestroy($img_dst);
return true;
}
else
return false;
}im not very expierenced with GDlib and i could not find anyother people that have had a similar problem so if ne one can help thanks a bunch
~dull1554