Bug #79158 [NEW]: PHP-gd imagecreatefrombmp fails on 1-bit BMP

From: Date: Thu, 23 Jan 2020 08:03:13 +0000
Subject: Bug #79158 [NEW]: PHP-gd imagecreatefrombmp fails on 1-bit BMP
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225056@lists.php.net to get a copy of this message
From: php dot bugreport at tbspace dot de Operating system: Linux x64 PHP version: 7.4.1 Package: GD related Bug Type: Bug Bug description:PHP-gd imagecreatefrombmp fails on 1-bit BMP Description: ------------ When loading a 1-bit BMP bitmap with gd's imagecreatefrombmp, the resulting image data is corrupted (skewed?). Here's a screenshot of the problem: https://screenshot.tbspace.de/wjstqfduhnk.png And here's a test 1-bit bitmap: https://tbspace.de/content/downloads/042-1rr1.bmp All other tools I tried (ImageMagick, IrfanView, MS Paint) can open this file just fine, so I think this is a PHP-GD issue. Test script: --------------- <?php $im = imagecreatefrombmp("042-1rr1.bmp"); imagepng($im); Expected result: ---------------- Binary data. Write to a .png file with php test.php > test.png and open the .png file in an image viewer. Actual result: -------------- Resulting .png image is skewed/corrupted. (see screenshot in description for an example) -- Edit bug report at https://bugs.php.net/bug.php?id=79158&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79158&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79158&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79158&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79158&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79158&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79158&r=support Expected behavior: https://bugs.php.net/fix.php?id=79158&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79158&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79158&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79158&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79158&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79158&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79158&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79158&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79158&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79158&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79158&r=mysqlcfg

« previous php.bugs (#225056) next »