getimagesize not working on images from MYSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	$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???

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux