Jump to content

jonw118

Members
  • Posts

    77
  • Joined

  • Last visited

    Never

Posts posted by jonw118

  1. Thanks for the help!

     

    This is where I have no idea what I'm doing... this is a site we had custom programmed. I know just enough PHP to be dangerous when it comes to this.

     

    This is something my developers never really addresses/fixed - the grainy images.

  2. 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";

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.