From db2a960dd5ad7a0d5e833de7561e81fc4d567ac3 Mon Sep 17 00:00:00 2001 From: Jonathan Ernst Date: Thu, 27 Jan 2005 16:13:03 +0000 Subject: [PATCH] * force usage of GD 1 functions --- include/image.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/include/image.php b/include/image.php index 905692c..aacc4dd 100644 --- a/include/image.php +++ b/include/image.php @@ -197,16 +197,14 @@ class Image { function resize_image($new_width, $new_height) { // GD 2.x - if(function_exists("imagecreatetruecolor")) - $new = imagecreatetruecolor($new_width, $new_height); - else // GD 1.x - $new = imagecreate($new_width, $new_height); + // $new = imagecreatetruecolor($new_width, $new_height); + // GD 1.x + $new = imagecreate($new_width, $new_height); // GD 2.x - if(function_exists("imagecopyresampled")) - imagecopyresampled($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height); - else // GD 1.x - imagecopyresized($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height); + // imagecopyresampled($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height); + // GD 1.x + imagecopyresized($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height); $this->set_debuglog("imagecopyresized($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height);"); imagedestroy($this->image); @@ -232,10 +230,9 @@ class Image { /* We multiply the border width by two because there are are borders at both sides */ // GD 2.x - if(function_exists("imagecreatetruecolor")) - $new = imagecreatetruecolor($new_width + ($border_width*2), $new_height + ($border_width*2)); - else // GD 1.x - $new = imagecreate($new_width + ($border_width*2), $new_height + ($border_width*2)); + // $new = imagecreatetruecolor($new_width + ($border_width*2), $new_height + ($border_width*2)); + // GD 1.x + $new = imagecreate($new_width + ($border_width*2), $new_height + ($border_width*2)); /* Make the border by filling it completely, later on we will overwrite everything except the border */ @@ -243,10 +240,9 @@ class Image { imagefill($new,0,0,$color); // GD 2.x - if(function_exists("imagecopyresampled")) - imagecopyresampled($new,$this->image,$border_width,$border_width,0,0, $new_width,$new_height,$this->width,$this->height); - else // GD 1.x - imagecopyresized($new,$this->image,$border_width,$border_width,0,0,$new_width,$new_height,$this->width,$this->height); + // imagecopyresampled($new,$this->image,$border_width,$border_width,0,0, $new_width,$new_height,$this->width,$this->height); + // GD 1.x + imagecopyresized($new,$this->image,$border_width,$border_width,0,0,$new_width,$new_height,$this->width,$this->height); $this->set_debuglog("imagecopyresized($new,$this->image,$border_width,$border_width,0,0," ." $new_width,$new_height,$this->width,$this->height); with a $border_width px border"