Bug #72596 [NEW]: imagetypes function won't advertise WEBP support
| From: | chris at ocproducts dot com | Date: | Thu, 14 Jul 2016 12:52:26 +0000 |
| Subject: | Bug #72596 [NEW]: imagetypes function won't advertise WEBP support | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-202321@lists.php.net to get a copy of this message | ||
From: chris at ocproducts dot com
Operating system:
PHP version: Irrelevant
Package: GD related
Bug Type: Bug
Bug description:imagetypes function won't advertise WEBP support
Description:
------------
The imagetypes function will not return a bitmask value for if WEBP
support is available, which is available with read/write since PHP 5.5.
All other formats are currently covered (except for GD which is implied,
and XBM which is implied by XPM).
Here's the code from PHP7 to confirm...
/* {{{ proto int imagetypes(void)
Return the types of images supported in a bitfield - 1=GIF, 2=JPEG,
4=PNG, 8=WBMP, 16=XPM */
PHP_FUNCTION(imagetypes)
{
int ret=0;
ret = 1;
#ifdef HAVE_GD_JPG
ret |= 2;
#endif
#ifdef HAVE_GD_PNG
ret |= 4;
#endif
ret |= 8;
#if defined(HAVE_GD_XPM)
ret |= 16;
#endif
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(ret);
}
Personally I'd recommend just dropping the function, given that GD-Info
returns details in its report and you can just use function_exists.
Removing a function and a set of constants may lower the PHP overhead
slightly. But if it stays it should be consistent with what PHP can do.
--
Edit bug report at https://bugs.php.net/bug.php?id=72596&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72596&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72596&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72596&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72596&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72596&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72596&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72596&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72596&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72596&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72596&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72596&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72596&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72596&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72596&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72596&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72596&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72596&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72596&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72596&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72596&r=mysqlcfg