Jump to content

changing something in gd.php.inc


ccrevcypsys

Recommended Posts

hello

i need help changing the directory that gd is uploading to include the .$date_str."_". because it is not. here is teh src info from gd.

 

class thumbnail
{
var $img;

function thumbnail($imgfile="",$width="",$height="")
{
	global $config;

	//detect image format
	$this->img["format"]=ereg_replace(".*\.(.*)$","\\1",$imgfile);
	$this->img["format"]=strtoupper($this->img["format"]);

	if($config['gdversion']>0)
	{

		if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG")
		{
			//JPEG
			$this->img["format"]="JPEG";
			$this->img["src"] = imagecreatefromjpeg($imgfile);

		}
		elseif($this->img["format"]=="PNG")
		{
			//PNG
			$this->img["format"]="PNG";
			$this->img["src"] = imagecreatefrompng($imgfile);
		}
		elseif ($this->img["format"]=="GIF")
		{
			//GIF
			$this->img["format"]="GIF";
			$this->img["src"] = imagecreatefromgif($imgfile);
		}
		else
		{
			//DEFAULT
			echo "Not Supported File!";
			exit();
		}

		if($width>0 && $height>0)
		{

			$this->img["width"] = $width;
			$this->img["height"] = $height;

		}
		else
		{

			@$this->img["width"] = imagesx($this->img["src"]);
			@$this->img["height"] = imagesy($this->img["src"]);

		}

		//default quality jpeg
		$this->img["quality"] = $config['gdquality'];

	}
	else
	{

		return FALSE;

	}

}

Link to comment
https://forums.phpfreaks.com/topic/67925-changing-something-in-gdphpinc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.