|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21676 GetImageSize nolonger works
Submitted: 2003-01-15 23:20 UTC Modified: 2003-02-22 05:19 UTC
Avg. Score:4.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: moderator at blackpeeps dot com Assigned:
Status: Closed Package: GetImageSize related
PHP Version: 4.3.0 OS: RAQ4-Latest Patches/Apache 1.3.2
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: moderator at blackpeeps dot com
New email:
PHP Version: OS:


 [2003-01-15 23:20 UTC] moderator at blackpeeps dot com
Recently upgraded to PHP 4.3.0 with GD-2.0.1
Scripts worked fine before upgrade. 
After 4.3.0 upgrade, Sometimes GetImageSize works (returns probper width and height variables) and sometimes it does not (my resize functions are defaulting to 1x2 pixels) 

At first I thought the problem was isolated to jpgs created with prior version PHP 4.1.2 and GD-2.0.0 and imagecreatefromjpeg function.  Then I noticed that there are photos were an image tag (imagecreatefromjpeg) was not used. So the problem is only occuring with certain files.)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-16 12:51 UTC]
GetImageSize is not related to GD in anyway. Please provide a sample image, which could be used to duplicate the problem you describe.
 [2003-01-16 13:32 UTC] moderator at blackpeeps dot com
This image returns null information on GetImageSize:

This image does return correct Width and Height info:";

I have even tried downloading the first and uploading back to server to make sure there is not a Binary file transfer issue. No luck. 

Here is a file that my Thumbnail script is not creating a thumbnail for. Well, actually, it creates a Blacked out thumbnail. The script uses ( GetImgageSize , imagecreatetruecolor, and ImageCreateFromJPEG )
 [2003-02-22 05:19 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

This one has been fixed by fixing a streams issue.
 [2004-02-11 07:33 UTC] balbaz17 at yahoo dot fr
I am having the same problem of Getimagesize returning nothing. 
From what i have read, i need to install the latest CVS. But I am not familiar with CVS, and wondering if there's any backdraws resulting from using CVS? Will i have to change my PHP or Apache configuration?
Does it worh it using CVS just to fix the Getimagesize bug?

Thanks in advance
 [2004-03-04 07:47 UTC] php at ninj4 dot org
Me too!  However, me too over a year later, using php 
4.3.3  (I'm assuming that last years CVS changes are 
into the release version by now)

Certain images, I can't really tell how they differ 
from other images, simply cause getimagesize() to fail.  
If one opens the problem image in an editor like 
Photoshop and resave them as jpegs (as a new file), 
they tend to work OK.  I have tried 'washing' uploaded 
images through Imagemagick, jpegtran and even via:

exec (djpeg <file> | cjpeg -p -r 1 <outputfile>);

I'm effectively resampling the image to a new file 
here, same as opening it in Photoshop and resaving (I 

See samples of working and non-working images here: (works) (doesn't 

I'm seeing this problem on multiple systems (one Red 
Hat ES7, one FreeBSD, one Debian, all on Apache 1.3) 
and with multiple image sources  - although certain 
digital cameras seem to produce the borked images more 
often than others - the LG2100V cameraphone will do it 
every time, as far as I can tell.

I hope this helps, or someone can help me!
 [2004-03-04 07:49 UTC] php at ninj4 dot org
Ahem.  Sorry, these urls are the right ones: (working) (broken)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 03:01:29 2024 UTC