View Single Post
  #1 (permalink)  
Old 07-22-2005, 05:14 PM
Jerry's Avatar
Jerry Jerry is offline
WebProWorld Pro
 

Join Date: Nov 2003
Location: Northern Texas
Posts: 259
Jerry RepRank 0
Default Help! thumbnail function not working properly

I have a function to generate thumbnail images. the function is working. Code is as follows:
Code:
<?php
function thumb($pic)
{
	//echo "function thumb running
";
	$image =  $pic;                
     $size = getimagesize("$image");
       $height = $size[1];
       $width = $size[0];
     if ($height > 150)
         {
               $height = 150;
               $percent = ($size[1] / $height);
               $width = round($size[0] / $percent);
         }
     else if ($width > 150)
         {
               $width = 150;
               $percent = ($size[0] / $width);
               $height = round($size[1] / $percent);
         }
     return '<img src=\"http://www.easystreet247.com/upload_files/$image\" height=\"$height\" width=\"$width\" >';
}
?>
The problem is that the image is not displaying when I call the function in code as follows:
Code:
$stuff0 = "<TR><td><table border=\"0\"><tr><td><a href=\"upload_files/$fullsize\" onclick=\"window.open(this.href); return false;\">thumb($thumbnail)</a>  </td><td></td>";
All that gets displayed is the name of the image as a hyperlink, instead of the image itself. I'm sure it's in the string settings, but I'm having a devil of a time figuring it out.

Can someone please help me with the string settings?
Reply With Quote