Bug #79158 [Opn->Dup]: PHP-gd imagecreatefrombmp fails on 1-bit BMP
| From: | cmb@php.net | Date: | Thu, 23 Jan 2020 08:28:05 +0000 |
| Subject: | Bug #79158 [Opn->Dup]: PHP-gd imagecreatefrombmp fails on 1-bit BMP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225058@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79158&edit=1
ID: 79158
Updated by: cmb@php.net
Reported by: php dot bugreport at tbspace dot de
Summary: PHP-gd imagecreatefrombmp fails on 1-bit BMP
-Status: Open
+Status: Duplicate
Type: Bug
Package: GD related
Operating System: Linux x64
PHP Version: 7.4.1
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is a duplicate of bug #77391, which is fixed in PHP's bundled
libgd as of PHP 7.2.15/7.3.2; it also has been fixed in the
development branch of upstream[1], but no new release has been
made since then.
[1] <https://github.com/libgd/libgd/issues/450>
Previous Comments:
------------------------------------------------------------------------
[2020-01-23 08:03:13] php dot bugreport at tbspace dot de
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 this bug report at https://bugs.php.net/bug.php?id=79158&edit=1