--- Mijn iMac:Users:Stefan:Desktop:drupal:includes:image.inc 2005-03-10 16:38:51.%N +0100
+++ Mijn iMac:Users:Stefan:Desktop:iStyledThis.nl:includes:image.inc 2005-03-11 18:50:57.%N +0100
@@ -55,11 +55,12 @@
$function = 'image_'. $toolkit .'_'. $method;
if (function_exists($function)) {
return call_user_func_array($function, $params);
}
else {
- drupal_set_message(t('%method is not supported by %toolkit.', array('%method' => "$method", '%toolkit' => "$toolkit")));
+ drupal_set_message(t('Due to a server misconfiguration, the image can not be processed correctly.'), 'error');
+ watchdog('php', t("The selected image manipulation toolkit '%toolkit' can not correctly process '%function'.", array('%toolkit' => "$toolkit", '%function' => "$function")), WATCHDOG_ERROR);
}
}
}
@@ -167,11 +168,11 @@
/**
* Verify GD settings (that the extension is actually installed).
*/
function image_gd_settings() {
if (!extension_loaded('gd')) {
- drupal_set_message(t('Unable to load the GD toolkit'), 'error');
+ drupal_set_message(t('To make advantage of automatic image manipulation, please install GD, ImageMagick or NetPBM for PHP.'), 'error');
return false;
}
return true;
}
@@ -191,15 +192,14 @@
$im = image_gd_open($source, $info['extension']);
if (!$im) {
return false;
}
- // GD1 doesn't have true color
- if (function_exists('imageCreateTrueColor')) {
- $res = imageCreateTrueColor($width, $height);
- }
- else {
+ // Suppress error if imageCreateTrueColor() fails: GD < 2
+ $res = @imageCreateTrueColor($width, $height);
+
+ if (!$res) {
$res = imageCreate($width, $height);
}
// GD1 doesn't have copyResampled
if (function_exists('imageCopyResampled')) {
@@ -250,15 +250,14 @@
return false;
}
$im = image_gd_open($source, $info['extension']);
- // GD1 doesn't have true color
- if (function_exists('imageCreateTrueColor')) {
- $res = imageCreateTrueColor($width, $height);
- }
- else {
+ // Suppress error if imageCreateTrueColor() fails: GD < 2
+ $res = @imageCreateTrueColor($width, $height);
+
+ if (!$res) {
$res = imageCreate($width, $height);
}
imageCopy($im, $res, 0, 0, $x, $y, $width, $height);