php.net |  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
Votes:15
Avg. Score:4.2 ± 0.9
Reproduced:13 of 13 (100.0%)
Same Version:7 (53.8%)
Same OS:4 (30.8%)
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
18 + 36 = ?
Subscribe to this entry?

 
 [2016-02-03 17:35 UTC] captlid at yahoo dot com
Description:
------------
---
From manual page: http://www.php.net/function.getimagesize
---

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 5.4.1.4, 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="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/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
</text>
</svg>

Expected result:
----------------
the width and height of the image 

output:

150 500

Actual result:
--------------
nothing shows.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-07 18:09 UTC] cmb@php.net
-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] cmb@php.net
SVG is not yet supported by getimagetype(), so this qualifies as
feature request.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 16:01:28 2019 UTC