[drupal-devel] [bug] image.gd.inc isn't compatible with gd 1

stefan nagtegaal drupal-devel at drupal.org
Fri Mar 11 18:03:33 UTC 2005


Issue status update for http://drupal.org/node/18700

 Project:      Drupal
 Version:      4.5.2
 Component:    base system
 Category:     bug reports
 Priority:     critical
-Assigned to:  Anonymous
+Assigned to:  stefan nagtegaal
 Reported by:  stefan nagtegaal
 Updated by:   stefan nagtegaal
-Status:       active
+Status:       patch
 Attachment:   http://drupal.org/files/issues/image-inc.patch (2.26 KB)

Attached patch improves:
- the way which deals with the detection of GD 1 or GD 2;
- error messages as reported by Steven here:
http://drupal.org/node/17645;
After applying this to HEAD/Drupal 4.6 RC, we can close the following
issues:
- http://drupal.org/node/17645;
- http://drupal.org/node/13027;
Please test/comment and apply attached patch..


stefan nagtegaal



Previous comments:
------------------------------------------------------------------------

March 10, 2005 - 19:13 : stefan nagtegaal

The idea behind the image.gd.inc file is that it should be usable for
people who are using GD 1 and GD 2.
Unfortunatly, the way it is written now, only support for GD 2 can be
given because:
Current way of determining GD 2, is not right:
if (function_exists('imageCreateTrueColor')) {
  // GD 2 Handling;
}
else {
  // GD 1 Handling
}
this doesn't work.. imageCreateTrueColor() was already implemented in
GD 1, only it failed to work properly..
See these pages:
http://www.php.net/imagecratetruecolor#25234 &
http://www.php.net/imagecratetruecolor#25487
According to this comments, we should implement this like this:
// Silence errors using the @
$image = @imageCreateTrueColor(......);
if (!$image) {
  // GD 1 Handling;
}





More information about the drupal-devel mailing list