Page 1 of 2

how to install GD2 library

Posted: Sat Mar 05, 2005 12:22 am
by itsmani1
i hav downloaded both gd & gd2 libraries
can any one tell me how to install them?
plz.......

Posted: Sat Mar 05, 2005 12:23 am
by feyd
hmm follow the directions?

Posted: Sat Mar 05, 2005 12:25 am
by itsmani1
well i hav downloaded libraries and i also hav placed them in exetensions folder wot else i should do in order to make them working?
------------------

error message:
Fatal error: imagecreatetruecolor(): requires GD 2.0 or later in

Posted: Sat Mar 05, 2005 12:27 am
by feyd
did you edit your php.ini :?:

Posted: Sat Mar 05, 2005 12:27 am
by itsmani1
yeah i did it

Posted: Sat Mar 05, 2005 12:29 am
by feyd
and restart your server?

Posted: Sat Mar 05, 2005 12:34 am
by itsmani1
yeah i did and its saying:

php.exe - Unable to locate component

this application has failed to stat because php5ts_debig.dll was not found. Re-installing this application may fix this problem

Ok

Posted: Sat Mar 05, 2005 12:35 am
by smpdawg
Is that DLL in your windows system directory? It is sometimes sitting in a folder under the php install but it may not be on the path for Windows to find it.

Posted: Sat Mar 05, 2005 12:37 am
by itsmani1
where i should i place this dll exectly?
i mean to say is : in which directry of my sys.

Posted: Sat Mar 05, 2005 12:38 am
by feyd
why are you using php5 debug?

Posted: Sat Mar 05, 2005 12:39 am
by smpdawg
Your windows system32 directory. Or you can edit your environment and add the path to the dll to it.

Posted: Sat Mar 05, 2005 12:42 am
by itsmani1
no i m using 4.1.1

Posted: Sat Mar 05, 2005 12:45 am
by smpdawg
But your previous post refers to a PHP5 dll...

Posted: Sat Mar 05, 2005 12:49 am
by itsmani1
sorry man that was my mistake
any way plz help me man.
here is the script i m using for test purpose:

Code: Select all

//IMAGE RESIZE FUNCTION FOLLOW ABOVE DIRECTIONS
function makeimage($filename,$newfilename,$path,$newwidth,$newheight) {

	//SEARCHES IMAGE NAME STRING TO SELECT EXTENSION (EVERYTHING AFTER . )
	$image_type = strstr($filename, '.');

	//SWITCHES THE IMAGE CREATE FUNCTION BASED ON FILE EXTENSION
		switch($image_type) {
			case '.jpg':
				$source = imagecreatefromjpeg($filename);
				break;
			case '.png':
				$source = imagecreatefrompng($filename);
				break;
			case '.gif':
				$source = imagecreatefromgif($filename);
				break;
			default:
				echo("Error Invalid Image Type");
				die;
				break;
			}
	
	//CREATES THE NAME OF THE SAVED FILE
	$file = $newfilename . $filename;
	
	//CREATES THE PATH TO THE SAVED FILE
	$fullpath = $path . $file;

	//FINDS SIZE OF THE OLD FILE
	list($width, $height) = getimagesize($filename);

	//CREATES IMAGE WITH NEW SIZES
	$thumb = imagecreatetruecolor($newwidth, $newheight);

	//RESIZES OLD IMAGE TO NEW SIZES
	imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

	//SAVES IMAGE AND SETS QUALITY || NUMERICAL VALUE = QUALITY ON SCALE OF 1-100
	imagejpeg($thumb, $fullpath, 60);

	//CREATING FILENAME TO WRITE TO DATABSE
	$filepath = $fullpath;
	
	//RETURNS FULL FILEPATH OF IMAGE ENDS FUNCTION
	return $filepath;

}

Posted: Sat Mar 05, 2005 12:52 am
by smpdawg
Is PHP loading now? What problem are you having?