#51063 [Opn]: Add getimagesizefromstring

From: Date: Wed, 17 Feb 2010 03:59:22 +0000
Subject: #51063 [Opn]: Add getimagesizefromstring
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147738@lists.php.net to get a copy of this message
 ID:              51063
 User updated by: bfrance@php.net
 Reported By:     bfrance@php.net
 Status:          Open
 Bug Type:        Feature/Change Request
 PHP Version:     5.3.1
 New Comment:

Here is a test for the new function:

http://www.brianfrance.com/software/php/getimagesizefromstring/001.phpt

and the required test.gif (php logo image):

http://static.php.net/www.php.net/images/php.gif


Previous Comments:
------------------------------------------------------------------------

[2010-02-16 21:54:26] bfrance@php.net

Description:
------------
It would be nice to be able to pass in a string to getimagesize.

Here is a patch that takes the original getimagesize function and turns
it into php_getimagesize_from_stream.  Then getimagesize and a new
function getimagesizefromstring can use the function once a stream is
created.

http://www.brianfrance.com/software/php/getimagesizefromstring.diff



Reproduce code:
---------------
<?PHP
$img = 'test.gif';

var_dump(getimagesize($img));

$data = file_get_contents($img);

var_dump(getimagesizefromstring($data));
?>




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=51063&edit=1



Thread (5 messages)

« previous php.bugs (#147738) next »