How can I make the images for the thumbnail previews bigger? When ever I change the 100 in the $width it just changes the height not the width.
Code:
if (empty($errors))
{
$forceredirect = true;
$newfilename = $name . '_' . $random . '.' . $ext;
move_uploaded_file($vbulletin->GPC['image']['tmp_name'], $dl->url.$newfilename);
chmod($dl->url.$newfilename, 0666);
$thumb = $name.'_'.$random.'_thumb.'.$ext;
if (($ext == 'jpg') OR ($ext == 'jpeg'))
{
$orig_image = imagecreatefromjpeg($dl->url.$newfilename);
}
else if ($ext == 'png')
{
$orig_image = imagecreatefrompng($dl->url.$newfilename);
}
else if ($ext == 'gif')
{
$orig_image = imagecreatefromgif($dl->url.$newfilename);
}
list($width, $height, $type, $attr) = @getimagesize($dl->url.$newfilename);
if ($width > 100)
{
$ratio = 100 / $width;
$newheight = $ratio * $height;
}
else
{
$newheight = $height;
}
$destimg = @imagecreatetruecolor(100, $newheight);
imagecopyresampled($destimg, $orig_image, 0, 0, 0, 0, 100, $newheight, imagesx($orig_image), imagesy($orig_image));
if (($ext == 'jpg') OR ($ext == 'jpeg'))
{
@imagejpeg($destimg, $dl->url.$thumb);
}
else if ($ext == 'png')
{
@imagepng($destimg, $dl->url.$thumb);
}
else if ($ext == 'gif')
{
@imagegif($destimg, $dl->url.$thumb);
}
@imagedestroy($destimg);