php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44239 getimagesize should be able to work on string data as well...
Submitted: 2008-02-25 04:02 UTC Modified: 2015-07-18 14:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: npeelman at cfl dot rr dot com Assigned: cmb (profile)
Status: Closed Package: GetImageSize related
PHP Version: 5.1.6 OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: npeelman at cfl dot rr dot com
New email:
PHP Version: OS:

 

 [2008-02-25 04:02 UTC] npeelman at cfl dot rr dot com
Description:
------------
  Any reason why getimagesize couldn't be extended to accept image data in string format such as:

array getimagesize (string $filename | string $string [, array &$imageinfo])

  This would be very handy for pulling image info from data stored in cache (such as APC) or BLOB data from a database without first converting with imagecreatefromstring() -> temp file -> getimagesize($temp_file).

  I see BUG #25507 but no example is given on how to achieve it. It seems to me that the binary data in the string variable is already in the format needed. 

  I'm actually on PHP version 5.1.6 (ubuntu linux) as per phpinfo().

Thank you for your time,
Norman Peelman

Reproduce code:
---------------
n/a

Expected result:
----------------
n/a

Actual result:
--------------
n/a

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-25 23:22 UTC] npeelman at cfl dot rr dot com
Ok, I found the example for using streams with variables and it works just fine with getimagesize but, I still think it would be easy enough for getimagesize to simply work on the string variable should the attempt to open a filename fails.
 [2011-04-08 21:10 UTC] jani@php.net
-Package: Feature/Change Request +Package: GetImageSize related
 [2015-07-18 14:09 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-07-18 14:09 UTC] cmb@php.net
As of PHP 5.4.0 there is getimagesizefromstring() which makes this
possible.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC