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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nirvn dot asia at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 10:01:38 2025 UTC