Both lossless and lossy WebP can have an alpha channel, but this is
somewhat hard to detect. Furthermore, it is not clear whether an alpha
channel should be counted for getimagesize(). Therefore we remove the
`channel` element from the result array.
switch (format) {
case ' ':
- result->width = (buf[14]) + ((buf[15] & 0x3F) << 8);
- result->height = (buf[16]) + ((buf[17] & 0x3F) << 8);
+ result->width = buf[14] + ((buf[15] & 0x3F) << 8);
+ result->height = buf[16] + ((buf[17] & 0x3F) << 8);
break;
case 'L':
result->width = buf[9] + ((buf[10] & 0x3F) << 8) + 1;
break;
}
result->bits = 8; /* always 1 byte */
- switch (format) {
- case ' ':
- result->channels = 3; /* always YUV */
- break;
- case 'L':
- result->channels = 4; /* always ARGB */
- break;
- }
return result;
}
string(9) "image/gif"
}
["test3llpix.webp"]=>
- array(7) {
+ array(6) {
[0]=>
int(1)
[1]=>
string(20) "width="1" height="3""
["bits"]=>
int(8)
- ["channels"]=>
- int(4)
["mime"]=>
string(10) "image/webp"
}
["test3pix.webp"]=>
- array(7) {
+ array(6) {
[0]=>
int(1)
[1]=>
string(20) "width="1" height="3""
["bits"]=>
int(8)
- ["channels"]=>
- int(3)
["mime"]=>
string(10) "image/webp"
}