Page 1 of 1

Having trouble with getimagesize from a recordset

Posted: Sun Jul 11, 2010 10:46 am
by vcarter
I am trying to use getimagesize from images in a table. This is what I'm doing:

Code: Select all

<?php
$image=$row_Recordset1['image']; //image name from the table
$imagePath="_img/gallery/thumbs/"; //path to image
$filename=$imagePath.$image; //concatenate path and image name
$imageInfo=getimagesize($filename);
echo $image."<br><br>"; // testing image name
echo $filename."<br><br>"; // testing full path to image
print_r($imageInfo);
echo file_exists($filename)?"Exists":"Doesn't exist"; echo "<br><br>";
?>
$image displays the proper image name...
$filename displays the proper path to the image...
I can display the image using either of the above variables...

ie:

Code: Select all

<img src="<?php echo $filename ?>" /><br /><br />
<img src="_img/gallery/thumbs/<?php echo $row_Recordset1['image']; ?>" width="263" height="175" alt="" />
However, I get "Doesn't exist" when testing if the file exists, and I'm unable to get the information from getimagesize.

Any ideas?