|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2014-04-13 22:27 UTC] stas@php.net
[2014-04-13 22:27 UTC] stas@php.net
-Status: Open
+Status: Closed
[2014-04-13 22:41 UTC] stas@php.net
[2014-04-15 12:04 UTC] ab@php.net
[2014-04-15 13:05 UTC] ab@php.net
[2014-05-01 14:59 UTC] tyrael@php.net
[2014-10-07 23:15 UTC] stas@php.net
[2014-10-07 23:26 UTC] stas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ The functions getimagesize, and getimagesizefromstring treat the height field of a BITMAPINFOHEADER header as an unsigned integer, while it really is a signed integer. On platforms with 64 bit PHP integers, this results in height being reported as 4294966272 for an image with height -1024, instead of the expected result height=1024. Test script: --------------- <?php $image_data = "Qk06AAAAAAAAADYAAAAoAAAAAQAAAP////8BABgAAAAAAAQAAADDDgAAww4AAAAAAAAAAAAA////AA=="; var_dump(getimagesizefromstring(base64_decode($image_data))); ?> Expected result: ---------------- array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(6) [3]=> string(20) "width="1" height="1"" ["bits"]=> int(24) ["mime"]=> string(14) "image/x-ms-bmp" } Actual result: -------------- array(6) { [0]=> int(1) [1]=> int(4294967295) [2]=> int(6) [3]=> string(21) "width="1" height="-1"" ["bits"]=> int(24) ["mime"]=> string(14) "image/x-ms-bmp" }