$CFG->smtphosts = "";
+// There is no way, currently, to automatically tell whether the graphic
+// library GD is version 1.* or 2.*. Specify that here (either 1 or 2).
+
+$CFG->gdversion = 1;
+
+
// You should not need to change anything else. To continue setting up
// Moodle, use your web browser to go to the moodle/admin web page.
///////////////////////////////////////////////////////////////////////////
case 3: $im = ImageCreateFromPNG($imagefile); break;
default: error("Image must be in JPG or PNG format");
}
- if (function_exists("ImageCreateTrueColor")) {
+ if (function_exists("ImageCreateTrueColor") and $CFG->gdversion >= 2) {
$im1 = ImageCreateTrueColor(100,100);
$im2 = ImageCreateTrueColor(35,35);
} else {
function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {
- if (function_exists("ImageCopyResampled")) { // Assumes gd >= 2.0.1 as well
+ global $CFG;
+
+ if (function_exists("ImageCopyResampled") and $CFG->gdversion >= 2) {
return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,
$dst_w, $dst_h, $src_w, $src_h);
}