Bug #65749 [NEW]: getimagesize not returning channels for png and bmp
From: nettum at gmail dot com
Operating system:
PHP version: Irrelevant
Package: GetImageSize related
Bug Type: Bug
Bug description:getimagesize not returning channels for png and bmp
Description:
------------
getimagesize does not contain 'channel' in the returning array when you run
getimagesize on a PNG or BMP image.
The documentation (http://php.net/manual/en/function.getimagesize.php)
specifies
that it will always return an array with 7 elements. This does not seem to
be the
case. Se script output below.
Test script:
---------------
<?php
$file_jpg = "test.jpg";
$file_png = "tux.png";
$info_jpg = getimagesize($file_jpg);
$info_png = getimagesize($file_png);
echo "\nJPG:";
print_r($info_jpg);
echo "\nPNG:";
print_r($info_png);
?>
Expected result:
----------------
JPG:Array
(
[0] => 463
[1] => 399
[2] => 2
[3] => width="463" height="399"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
PNG:Array
(
[0] => 400
[1] => 479
[2] => 3
[3] => width="400" height="479"
[bits] => 8
[channels] => 4
[mime] => image/png
)
Actual result:
--------------
JPG:Array
(
[0] => 463
[1] => 399
[2] => 2
[3] => width="463" height="399"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
PNG:Array
(
[0] => 400
[1] => 479
[2] => 3
[3] => width="400" height="479"
[bits] => 8
[mime] => image/png
)
--
Edit bug report at https://bugs.php.net/bug.php?id=65749&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65749&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65749&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65749&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65749&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65749&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65749&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65749&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65749&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65749&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65749&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65749&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65749&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65749&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65749&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65749&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65749&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65749&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65749&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65749&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65749&r=mysqlcfg
Thread (1 message)
- nettum at gmail dot com