getimagesize() - Works on one server and not another
Posted: Thu Oct 26, 2006 6:44 am
Hi,
I have code to generate thumbnail images that I have used in several sites and it works well... except that I tried loading it on a new server for a new site and it doesn't work properly. Here is the code:
Here is what I get:
<img src='/images/propertyimages/picname.jpg' border='0' style='width: px; height: px;'>
The path is correct and the filename is correct, but nothing appears on the page - it looks as though the file is not found. Clearly its not measuring the height or width. I have the errors turned on and nothing is generated. I'm lost!
Anyone have any suggestions?
I have code to generate thumbnail images that I have used in several sites and it works well... except that I tried loading it on a new server for a new site and it doesn't work properly. Here is the code:
Code: Select all
$image = ($_SERVER["DOCUMENT_ROOT"]."/".$photoRow['PicName']);
$size = getimagesize("$image");
$type = $size['mime'];
$height = $size[1];
$width = $size[0];
if ($height > 150)
{
$height = 150;
$percent = ($size[1] / $height);
$width = ($size[0] / $percent);
}
else if ($width > 150)
{
$width = 150;
$percent = ($size[0] / $width);
$height = ($size[1] / $percent);
}
echo "<img src='/images/propertyimages/".stripslashes($photoRow['PicName'])."' border='0' style='width: ".$width."px; height: ".$height."px;'><p>";<img src='/images/propertyimages/picname.jpg' border='0' style='width: px; height: px;'>
The path is correct and the filename is correct, but nothing appears on the page - it looks as though the file is not found. Clearly its not measuring the height or width. I have the errors turned on and nothing is generated. I'm lost!
Anyone have any suggestions?