|  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:28 of 29 (96.6%)
Same Version:14 (50.0%)
Same OS:16 (57.1%)
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Mon Jun 17 08:01:32 2024 UTC