|  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.1 ± 0.9
Reproduced:17 of 17 (100.0%)
Same Version:8 (47.1%)
Same OS:7 (41.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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 08:01:24 2020 UTC