Re: getimagesize not working on images from MYSQL
| From: | Burhan Khalid | Date: | Sat, 16 Jul 2005 11:11:04 +0000 |
| Subject: | Re: getimagesize not working on images from MYSQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218803@lists.php.net to get a copy of this message | ||
timothy johnson wrote:
$id = $_GET['id']; $query = "SELECT * FROM myPhotos WHERE photoId='$id'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $im = imagecreatefromstring($row[photoData]); $size = getimagesize($im); header('Content-Type: image/jpeg'); imagejpeg($im, NULL, 100); I have this nice little php page to return my images from a database, and everything runs fine except then I try to use getimagesize, I then get.. Warning: getimagesize(Resource id #4): failed to open stream: do I have to do something else, this function works fine if I am using it on a fileimage, why not an image from a database???Because the function expects a filename, not an image. Read the documentation for getimagesize. Regards, Burhan