php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50960 createimagefromwbmp fails to process some .bmp files (mime type: x-ms-bmp)
Submitted: 2010-02-08 01:42 UTC Modified: 2010-02-15 00:32 UTC
From: nirvn dot asia at gmail dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.3.1 OS: windows 2003
Private report: No CVE-ID: None
 [2010-02-08 01:42 UTC] nirvn dot asia at gmail dot com
Description:
------------
The GD function createimagefromwbmp() fails to process some .bmp (with mime type x-ms-bmp).

For developers, this bmp (http://www.licadho-cambodia.org/php/test.bmp) will show the bug.

Any chance of finding a quick fix for this one?

Reproduce code:
---------------
/* download http://www.licadho-cambodia.org/php/test.bmp */
$img = imagecreatefromwbmp(test.bmp')


Expected result:
----------------
The function reads the .bmp and stores the image into $img.

Actual result:
--------------
The function returns a warning (below) and $img is empty.

Warning: imagecreatefromwbmp() [function.imagecreatefromwbmp]: 'test.bmp' is not a valid WBMP file in ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-09 05:55 UTC] sks76543210 at gmail dot com
The gd library only supports wbmp files, not bmp. See comments at http://php.net/manual/en/function.imagecreate.php for an imagecreatefrombmp() function. (I have not tested it, so YMMV)
 [2010-02-15 00:32 UTC] kalle@php.net
WBMP != BMP, GD 2.1 will however natively support BMP, but there currently is not timeline for when it will be released nor included into the php distro.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 10:01:30 2024 UTC