|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71517 Implement SVG support for getimagesize() and friends
Submitted: 2016-02-03 17:35 UTC Modified: 2016-10-07 18:09 UTC
Avg. Score:4.2 ± 1.0
Reproduced:29 of 30 (96.7%)
Same Version:14 (48.3%)
Same OS:16 (55.2%)
From: captlid at yahoo dot com Assigned:
Status: Open Package: GetImageSize related
PHP Version: Irrelevant OS: windows 8.1 pro and linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: captlid at yahoo dot com
New email:
PHP Version: OS:


 [2016-02-03 17:35 UTC] captlid at yahoo dot com
From manual page:

The width and height for svg files is not outputting. Tested on windows 8.1, 7, xp professional versions, which ever linux godaddy runs on, php versions, apache server 2 
All software is 64 bit.

Test script:
$size = getimagesize("black150.svg"); 
echo $size[0]. ' ' .$size[1];
<img src="black150.svg" width="<?=$size[0]?>" height="<?=$size[1]?>">

The svg file for reference
<svg xmlns="" xmlns:xlink="" width="500" height="150">
<rect width="500" height="150" style="fill:black;stroke-width:0px;stroke:blue;" />
<text text-anchor="middle" y="5" fill="white" style="font-size:18pt;font-weight:bolder !important; font-family:times new roman">
Sample text, just for demonstration purposes

Expected result:
the width and height of the image 


150 500

Actual result:
nothing shows.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-07 18:09 UTC]
-Summary: getimagesize doesn't get width or height of svg +Summary: Implement SVG support for getimagesize() and friends -Type: Bug +Type: Feature/Change Request
 [2016-10-07 18:09 UTC]
SVG is not yet supported by getimagetype(), so this qualifies as
feature request.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 15:01:28 2024 UTC