|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28375 getimagesize only checks global gif header
Submitted: 2004-05-12 19:01 UTC Modified: 2004-05-12 19:03 UTC
Avg. Score:1.2 ± 0.5
Reproduced:0 of 4 (0.0%)
From: scottmacvicar at ntlworld dot com Assigned:
Status: Wont fix Package: GetImageSize related
PHP Version: 4CVS-2004-05-12 (stable) OS: *
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: scottmacvicar at ntlworld dot com
New email:
PHP Version: OS:


 [2004-05-12 19:01 UTC] scottmacvicar at ntlworld dot com
A getimagesize can return a wrong value if corruption or intentional editing has changed the values held in the global header for the gif.

It is possible to find the correct value by scanning through each frame and looking at the local image descriptor values for width and height and returning the largest value.

Both Mozilla and IE do this as standard and ignore the global height and width.

If anyone wants a sample gif I can email them it.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-12 19:03 UTC]
Scanning the entire gif file would be too slow. It would 
also require the retrieval of the entire file rather then 
just the header, which would be rather slow if the file is 
located on a remote server. 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 13:01:23 2020 UTC