02-14-2008, 12:54 AM
|
#3 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Alan @ CIT
We'll probably need to see the code before we can help
What do you mean that it works for you but not others? Does it work for anyone? If not, do they get errors?
Alan
|
PHP Code:
if (substr($type,6,12)=="png")
{
list($width,$height) = getimagesize($new_path);
$new_w = 345;
$new_h = 150;
$src_im = imagecreatefrompng($new_path);
$dst_im = imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_im,$src_im,0,0,0,0,$new_w,$new_h,$width,$height);
imagepng($dst_im, $thumb_path);
} else if (substr($type,6,12)=="gif")
{
list($width,$height) = getimagesize($new_path);
$new_w = 345;
$new_h = 150;
$src_im = imagecreatefromgif($new_path);
$dst_im = imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_im,$src_im,0,0,0,0,$new_w,$new_h,$width,$height);
imagegif($dst_im, $thumb_path);
} else if (substr($type,6,12)=="jpeg")
{
list($width,$height) = getimagesize($new_path);
$new_w = 345;
$new_h = 150;
$src_im = imagecreatefromjpeg($new_path);
$dst_im = imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_im,$src_im,0,0,0,0,$new_w,$new_h,$width,$height);
imagejpeg($dst_im, $thumb_path);
}
__________________
VillageIdiot can have my babbies ;d
|
|
|
|