I have a new website where the thumb images display VERY poorly. I want the images to display clearly.
I think it has something to do with the $thumbfactor, but as I change it, doesn't help the quality.
Can someone look at this and see if you see any setting you would change to make the thumb images not so grainy/pixelated?
Thanks much in advance:
function getImage($srcImg,$typImg){
switch($typImg){
case 1://Thumb
$cStr = "th_";
break;
case 2://Prev
$cStr = "pr_";
nreak;
}
$abc = explode("/",$srcImg);
$thumbName = $cStr.$abc[count($abc)-1];
$abc[count($abc)-1] = $thumbName;
$abc = implode("/",$abc);
return $abc;
}
function aspectRatio($width, $height ,$thumbFactor){
//-------Image Manipulation Constants---//
$thumbFactor = 110;
$imageThumbPrefix = "th_";
//-------------------------------------//
if ($width > $height){
$retWidth = $thumbFactor;
$retHeight = $thumbFactor * ($height / $width);
}
elseif ($width < $height){
$retHeight = 82;
$retWidth = $thumbFactor * $width / $height;
}
elseif ($width==$height){
$retWidth = $thumbFactor;
$retHeight = 82 ;
}
else die ("unknown scenario");
$outStr = $retWidth.",".$retHeight;
// $outStr = "100,100";
return $outStr;
}
function aspectRatio_user($width, $height ,$thumbFactor){
//-------Image Manipulation Constants---//
$thumbFactor = 115;
$imageThumbPrefix = "th_";
//-------------------------------------//
if ($width > $height){
$retWidth = $thumbFactor;
$retHeight = $thumbFactor * ($height / $width);
}
elseif ($width < $height){
$retHeight = $thumbFactor;
$retWidth = $thumbFactor * $width / $height;
}
elseif ($width==$height){
$retWidth = $thumbFactor;
$retHeight = $thumbFactor ;
}
else die ("unknown scenario");
$outStr = $retWidth.",".$retHeight;
// $outStr = "115,115";