|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-05-08 03:45 UTC] peter279k at gmail dot com
Description: ------------ According to the caution message in imagebmp function usage https://php.net/manual/en/function.imagebmp.php, it looks like the imagebmp should return false if it's failed to output the image. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
Test script: --------------- <?php $im = imagecreatefrombmp('./php.bmp'); // Save the image var_dump(imagebmp($im, './php.bmp')); // Free up memory imagedestroy($im); Expected result: ---------------- PHP Warning: imagecreatefrombmp(): './php.bmp' is not a valid BMP file in /root/bmp.php on line 3 PHP Warning: imagebmp() expects parameter 1 to be resource, bool given in /root/bmp.php on line 6 bool(false) PHP Warning: imagedestroy() expects parameter 1 to be resource, bool given in /root/bmp.php on line 9 Actual result: -------------- An error as follows: PHP Warning: imagecreatefrombmp(): './php.bmp' is not a valid BMP file in /root/bmp.php on line 3 PHP Warning: imagebmp() expects parameter 1 to be resource, bool given in /root/bmp.php on line 6 NULL PHP Warning: imagedestroy() expects parameter 1 to be resource, bool given in /root/bmp.php on line 9