This topic is locked

Width of thumbnails

1/28/2009 5:22:39 AM
PHPRunner General questions
A
alfonso authorDevClub member

In phprunner I can define maximum width or height of thumnails but I want only use this value to change witdh. I see this change in CreateThumbnail function. How can I disable to use this parameter as maximun height? Something must change into:
if($sx>$size || $sy>$size)

{

if($sx>=$sy)

{

$nsy=(integer)($sy$size/$sx);

$nsx=$size;

}

else

{

$nsx=(integer)($sx
$size/$sy);

$nsy=$size;

}

$thumb = imagecreatetruecolor($nsx,$nsy);

imagecopyresampled($thumb,$img,0,0,0,0,$nsx,$nsy,$sx,$sy);

ob_start();

if($ext==".JPG" || $ext=="JPEG")

imagejpeg($thumb);

elseif($ext==".PNG")

imagepng($thumb);

else

imagegif($thumb);

$ret=ob_get_contents();

ob_end_clean();

imagedestroy($img);

imagedestroy($thumb);

return $ret;

}
Thanks

J
Jane 1/28/2009

Hi,
here is a sample:

if($sx>$size)

{

$nsy=(integer)($sy*$size/$sx);

$nsx=$size;
$thumb = imagecreatetruecolor($nsx,$nsy);

...

A
alfonso authorDevClub member 2/4/2009

Hi,

here is a sample:


OK. Solved. Thanks