php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15797 Inconsistent Error Behavior.
Submitted: 2002-02-28 17:51 UTC Modified: 2002-02-28 18:09 UTC
From: mark at tapinternet dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.6 OS: linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mark at tapinternet dot com
New email:
PHP Version: OS:

 

 [2002-02-28 17:51 UTC] mark at tapinternet dot com
The function ImageCreateTrueColor() will cause a fatal error when it detects that an incorrect version of GD is installed.  Since the php code cannot investigate which version of GD is installed before this call is made, this makes it impossible to create applications which can gracefully degrade depending on the version of GD installed.  The fatal error is inconsistent with the warnings that are returned when GIF,PNG, or JPEG support is not compiled into GD.  The return value for all these functions should be a warning to allow maximum flexibility to the programmer.

if (! $Image = ImageCreateTrueColor($w,$h)) {
	$Image = ImageCreate($w,$h);
}

It is not possible to execute the above code because the fatal error when GD 2.0 is not installed will cease execution of the code.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-28 18:09 UTC] rasmus@php.net
This bug has been fixed in CVS.


 [2003-03-21 08:23 UTC] antoine at rezo dot net
This bug is supposedly fixed, but we hase users complaining about it in more recent versions of PHP.

See :
- v4.1.2: http://listes.rezo.net/archives/spip-dev/2003-03/msg00224.html
- v4.2.0: http://listes.rezo.net/archives/spip-dev/2003-03/msg00226.html

With this bug it is impossible to write portable programs. What is your suggestion for circumventing it ? I know of no way to detect the GD version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC