|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26688 getimagesize doesn't return correct width and height for bmp files
Submitted: 2003-12-22 06:33 UTC Modified: 2004-04-21 20:55 UTC
From: paul at i3 dot co dot uk Assigned:
Status: Closed Package: GetImageSize related
PHP Version: 4.3.4 OS: slackware
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 + 5 = ?
Subscribe to this entry?

 [2003-12-22 06:33 UTC] paul at i3 dot co dot uk
Contrary to 4.3.4 change log

Fixed width/height detection of bmp images using 
getimagesize() function on big endian systems and added 
code to retrieve bmp bit depth. (Ilia)

I still receive incorrect output when querying a local 

Expected result:
When queried with imagemagick identify verbose returns

Image: example.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Geometry: 800x560
  Class: DirectClass
  Type: true color
  Depth: 8 bits-per-pixel component
  Colors: 56670
  Filesize: 1312kb
  Interlace: None
  Background Color: white
  Border Color: #dfdfdf
  Matte Color: grey74
  Iterations: 0
  Tainted: False
  User Time: 0.0u
  Elapsed Time: 0:01

Tested with 20 or so similar sized bmp file same problem 

Actual result:
 files output using getimagesize returns

array(5) {
  string(33) "width="36700960" height="1572865""
  string(9) "image/bmp"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-22 10:53 UTC]
Please provide the bmp file in question.
 [2003-12-22 11:41 UTC] paul at i3 dot co dot uk
snapshot 4.3.5-dev resolves the problem tested with all 20 
each working correctly thanks Ilia.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 23:01:29 2024 UTC