* force usage of GD 1 functions
This commit is contained in:
committed by
Jeremy Newman
parent
d5a50ecec4
commit
db2a960dd5
@@ -197,15 +197,13 @@ class Image {
|
|||||||
function resize_image($new_width, $new_height)
|
function resize_image($new_width, $new_height)
|
||||||
{
|
{
|
||||||
// GD 2.x
|
// GD 2.x
|
||||||
if(function_exists("imagecreatetruecolor"))
|
// $new = imagecreatetruecolor($new_width, $new_height);
|
||||||
$new = imagecreatetruecolor($new_width, $new_height);
|
// GD 1.x
|
||||||
else // GD 1.x
|
|
||||||
$new = imagecreate($new_width, $new_height);
|
$new = imagecreate($new_width, $new_height);
|
||||||
|
|
||||||
// GD 2.x
|
// GD 2.x
|
||||||
if(function_exists("imagecopyresampled"))
|
// imagecopyresampled($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
|
||||||
else // GD 1.x
|
|
||||||
imagecopyresized($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height);
|
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);");
|
$this->set_debuglog("imagecopyresized($new,$this->image,0,0,0,0,$new_width,$new_height,$this->width,$this->height);");
|
||||||
@@ -232,9 +230,8 @@ class Image {
|
|||||||
/* We multiply the border width by two because there are are borders
|
/* We multiply the border width by two because there are are borders
|
||||||
at both sides */
|
at both sides */
|
||||||
// GD 2.x
|
// GD 2.x
|
||||||
if(function_exists("imagecreatetruecolor"))
|
// $new = imagecreatetruecolor($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
|
||||||
else // GD 1.x
|
|
||||||
$new = imagecreate($new_width + ($border_width*2), $new_height + ($border_width*2));
|
$new = imagecreate($new_width + ($border_width*2), $new_height + ($border_width*2));
|
||||||
|
|
||||||
/* Make the border by filling it completely,
|
/* Make the border by filling it completely,
|
||||||
@@ -243,9 +240,8 @@ class Image {
|
|||||||
imagefill($new,0,0,$color);
|
imagefill($new,0,0,$color);
|
||||||
|
|
||||||
// GD 2.x
|
// 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);
|
||||||
imagecopyresampled($new,$this->image,$border_width,$border_width,0,0, $new_width,$new_height,$this->width,$this->height);
|
// GD 1.x
|
||||||
else // GD 1.x
|
|
||||||
imagecopyresized($new,$this->image,$border_width,$border_width,0,0,$new_width,$new_height,$this->width,$this->height);
|
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,"
|
$this->set_debuglog("imagecopyresized($new,$this->image,$border_width,$border_width,0,0,"
|
||||||
|
|||||||
Reference in New Issue
Block a user