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:32
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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 02:01:31 2024 UTC