|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29424 Width and Height inverted for JPEG2000 files
Submitted: 2004-07-28 11:50 UTC Modified: 2005-03-06 18:05 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bertrand dot bourgier at free dot fr Assigned:
Status: Closed Package: GetImageSize related
PHP Version: 5.0.0 OS: Windows 2000 Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bertrand dot bourgier at free dot fr
New email:
PHP Version: OS:


 [2004-07-28 11:50 UTC] bertrand dot bourgier at free dot fr
Take a JPEG2000 file (indifferently JPC or JP2 format).
JPC format sample file:
JP2 format sample file:

I downloaded those 2 files so that I can do my tests locally and avoid any network related issue.

Then, when I run 'getimagesize' on those JPEG2000 files, I get a result, but the Width and Height information are inverted.

Reproduce code:
Test 1:
list($width, $height, $type, $attr) = getimagesize("p0_04.j2k");
echo "Width: $width<BR>Height: $height";

Test 2:
list($width, $height, $type, $attr) = getimagesize("file1.jp2");
echo "Width: $width<BR>Height: $height";

Expected result:
Test 1:
Width: 640
Height: 480

Test 2:
Width: 768
Height: 512

Actual result:
Test 1:
Width: 480
Height: 640

Test 2:
Width: 512
Height: 768

As you can see, Width and Height are inverted.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-12 17:40 UTC] tom at kornack dot com
I have seen this with php 5.0.0 on Mac OS X. I just had 
to code a kludge to fix this!
 [2005-03-06 18:05 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 05:01:29 2024 UTC