php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20094 image_type_to_mime_type() has wrong proto in php source
Submitted: 2002-10-25 13:06 UTC Modified: 2002-11-07 21:04 UTC
From: leon at leonatkinson dot com Assigned:
Status: Closed Package: *Graphics related
PHP Version: 4.3.0-pre1 OS:
Private report: No CVE-ID: None
 [2002-10-25 13:06 UTC] leon at leonatkinson dot com
Please add php_image_type_to_mime_type() to the documentation.

array image_type_to_mime_type(int imagetype)
Convert internal image_type to mime type

<?
    //returns "image/gif"
    print(image_type_to_mime_type(IMAGETYPE_GIF));
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-07 20:13 UTC] helly@php.net
Function is added at least in online help.
 [2002-11-07 20:53 UTC] philip@php.net
It's currently documented BUT there is a discrepancy.  According to the php4 proto, it returns an array.  According to the code, docs and examples, it returns a string.  The proto in image.c needs to be updated.  Opening as a graphics related bug.

php4/ext/standard/image.c
{{{ proto array image_type_to_mime_type(int imagetype)
...
ZVAL_STRING(return_value, (char*)php_image_type_to_mime_type(Z_LVAL_PP(p_image_type)), 1);
 [2002-11-07 21:04 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jan 17 23:01:24 2019 UTC