php.net |  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
Votes:52
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
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
6 + 40 = ?
Subscribe to this entry?

 
 [2004-05-12 19:01 UTC] scottmacvicar at ntlworld dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-12 19:03 UTC] iliaa@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 15:01:30 2024 UTC